Open samsunix opened 3 years ago
fixed YAMLoadWarning by changing config.py line 14
cfg = yaml.load(ymlfile) to cfg = yaml.load(ymlfile, Loader=yaml.FullLoader)
Hello, I have the same problem. After a quick examination, I believe the problem is that the code was made for an older version of discord.py.
You can try to install an older version, or use my solution:
Change line 46
from: await client.send_message(client.get_channel(str(config.getDiscordChannelList()[x]['channelID'])), newvideo)
to: await client.get_channel(int(config.getDiscordChannelList()[x]['channelID'])).send(newvideo)
The same with line 54
from: await client.send_message(client.get_channel(str(config.getDiscordChannelList()[x]['channelID'])), livestream)
to: await client.get_channel(int(config.getDiscordChannelList()[x]['channelID'])).send(livestream)
To explain:
client
is of type discord.Client(), in the rewritten discord.py, it no longer has the send_message method. So what I do, is first get the channel, then use its send
method, to send the message. Also, notice that the get_channel
method requires an int, not an str as in the original code.
I hope I helped and explained well enough, as I am no expert.
Trying to run this on Raspberry Pi Followed instructions launching with command 'python3 main.py' Bot is not posting
pi@pi:~/pipy_bot $ python3 main.py Logged in as: SamBot 768508391777107979
---------------------------------------
Bot running. Checking for new videos from <@samuli.pl> <@samuli.pl> IS LIVESTREAMING NOW! PUSHING UPDATE ON DISCORD. Rechecking in 04:57