azrood / dctbot Goto Github PK
View Code? Open in Web Editor NEWBot discord with multiple features
Bot discord with multiple features
typo in :
J'en connais qui a vu la mort devant en face !
Maybe we should use "has_role" decorator in help, team, and clear
To replace if else checks like :
if ctx.author.top_role >= bot.role_dcteam:
bonjourmadame fails when video.
I managed to get the last 2 items from feedburner (see attachments) with following code :
#!/usr/bin/python3
# -*-coding:utf-8 -*-
import requests
from bs4 import BeautifulSoup
madames = "http://feeds2.feedburner.com/BonjourMadame"
res = requests.get(madames)
soup = BeautifulSoup(res.text, "lxml")
items = soup.find_all('item', limit=2)
print("Video item")
print("------------------------------------------------------------")
print(items[0].prettify())
print("============================================================")
print("============================================================")
print("Image item")
print("------------------------------------------------------------")
print(items[1].prettify())
See attachment (first item has no img
tag but a video
one).
out.txt
Replace "roles" with "general" in
Line 95 in b5b1b59
On pourrait peut-être faire title, url = await latests_madame()
?
avec lates_madame()
qui ferait un return title, url
?
Line 44 in 516a11d
title
, on le trouverait avec un item.find('title')
Pour afficher le titre (genre "Madame Vendredi où l’amour de l’art.")
après, suffirait de l'envoyer (séparément de l'image) avec un 2ème send.
(soit comme ça, en texte, soit en faisant un set_footer
sur un embed vide.
Qu'en penses-tu ?
Line 62 in c7f69f8
Problem with boolean value stored as string :
"ph": {
"public": true,
"url": "https://media1.tenor.com/images/c9fd95f1d85889081532373d16432727/tenor.gif"
},
"quadran": {
"public": "true",
"url": "https://media1.tenor.com/images/3a7eeaf4e2a1fdfd0d00167f58b54c69/tenor.gif?itemid=12896767"
},
In line :
Line 543 in dc7ff70
your should use expansion (*args) :
like : https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html#variable
asyn def foo(ctx, *args):
In doing so, args will be a list (of variable lenght).
That is what you want to do.
The way you did it (with keyword-only argument), ie def foo(ctx, date, *, args="")
puts all your parameters (after date) in a single string.
And then you need to split it :
Line 54 in dc7ff70
So basically, what you do is forcing python to make a single string, and not a list.
And then, split that string, to get back to a list...
🤣
We have to test it, but I think the tests :
Line 386 in 017cd0a
Line 397 in 017cd0a
in gifadd and gifdelete are not needed anymore, since we use the decorator @commands.is_owner
https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.is_owner
Issue in dealabs :
2020-04-17 19:26:38,948 Bot: | discord.ext.tasks | ERROR | Internal background task failed.
Traceback (most recent call last):
File "/home/ady/.local/lib/python3.6/site-packages/discord/ext/tasks/__init__.py", line 68, in _loop
await self.coro(*args, **kwargs)
File "/sftp/dctbot/incoming/dctbot/cogs/dealabs.py", line 41, in auto_free_games
free_game_list = await get_free_games()
File "/sftp/dctbot/incoming/dctbot/cogs/dealabs.py", line 26, in get_free_games
for r in res
File "/sftp/dctbot/incoming/dctbot/cogs/dealabs.py", line 27, in <listcomp>
if "jeu" in r[0].text
IndexError: list index out of range
Line 70 in 51dbd3d
Replace 10 by 24 hours (frequency)
Line 488 in 2f317e9
Also :
with date lib
test date.today().weekday() value to see if not Saturday or Sunday
I love this
1a8e1bb
It's really smart and interesting, but it's not working ! 🤣🤣
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.