Giter VIP home page Giter VIP logo

dctbot's People

Contributors

adynemo avatar azrood avatar sergeileduc avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

sergeileduc

dctbot's Issues

Dealabs cog crash

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

Use expansion with *args

In line :

DCTbot/bot.py

Line 543 in dc7ff70

async def logs(ctx,date, *, args=""):

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 :

liste = args.split() # split the args into a list

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...

🤣

bonjourmadame fails on video

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

Use has_role decorator

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:

log-enhance

I love this
1a8e1bb

It's really smart and interesting, but it's not working ! 🤣🤣

Fetch title for bonjourmadame

On pourrait peut-être faire title, url = await latests_madame() ?
avec lates_madame() qui ferait un return title, url ?

url = await latest_madame()

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 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.