OtakuMegane / DerpyBot

An active learning chatbot using Markov chains.
MIT License
5 stars 3 forks source link

No discord messages sent #7

Closed ineptvirus closed 5 years ago

ineptvirus commented 5 years ago

Hi,

The lastest release seems to not be sending any messages to the discord channels, and occasionally gives an error as per test below. Of note is I have my mention replay rate set to 100 so the bot (In my setup named Mirai) should respond to all of these messages

`

D:\Mirai\DerpyBot-v0.9.3.8>C:\Users\Jake\AppData\Local\Programs\Python\Python37\python.exe D:\Mirai\DerpyBot-v0.9.3.8\derpybot.py D:\Mirai\DerpyBot-v0.9.3.8\derpybot.py:14: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead. config = SafeConfigParser(allow_no_value = True) [DerpyBot] DerpyBot version 0.9.3.8 [DerpyBot] Loading markov... [DerpyMarkov] DerpyMarkov version 0.9.3.10 [DerpyMarkov] Loading main dictionary... [DerpyMarkov] I know 1436 lines containing a total of 5802 words. [DerpyMarkov] 1802 of those words are unique. [DerpyMarkov] We are currently using a state size of 1 which generated 1803 contexts. [DerpyMarkov] Normal reply rate is 10.0 and bot name reply rate is 100.0. [DerpyBot] Loading chat client... [Discord Client] Discord Client version 0.9.2.9 [Discord Client] We have logged in to Discord! [Discord Client] Name: Mirai [Discord Client] ID: 417657851587330051 [Discord Client] Could not set 'Playing' status for some reason. [Discord Client] [DerpyBot] Entering command mode...

[Discord Client] Message from #testing-channel: Mirai hi [Discord Client] Message from #testing-channel: Mirai hi [Discord Client] Message from #testing-channel: Mirai hi [Discord Client] Message from #testing-channel: Mirai hi [Discord Client] Message from #testing-channel: Mirai hi Ignoring exception in on_message Traceback (most recent call last): File "C:\Users\Jake\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\client.py", line 255, in _run_event await coro(*args, **kwargs) File "D:\Mirai\DerpyBot-v0.9.3.8\clients\discord_client\discord_client.py", line 88, in on_message if message.channel.is_private: AttributeError: 'TextChannel' object has no attribute 'is_private' `

I have solved this in my fork, which I opened a thread for (issue #5 )

I'm not a frequent user of githut and I'm not sure how requesting to pull the fork works but I'll give it a shot

Tia

OtakuMegane commented 5 years ago

I'll take a look. Updating for the newer discord.py is next on my list now that I actually have some time to work on things here.

Edit: Got your fork merged into my new branch for 1.0 updating.

OtakuMegane commented 5 years ago

v0.9.3.9 should have this fixed, as well as the current updates from your fork.

snaildos commented 5 years ago

Is the problem fixed?

OtakuMegane commented 5 years ago

Tested on discord.py 1.0 and the older 0.16, no problems on either one.

snaildos commented 5 years ago

Ok! Attempting to try now, I can see that the error pops up NO more... Witch is good

snaildos commented 5 years ago

No, Aint working. As you can see: [DerpyBot] DerpyBot version 0.9.3.9 [DerpyBot] Loading markov... [DerpyMarkov] DerpyMarkov version 0.9.3.11 [DerpyMarkov] Loading main dictionary... [DerpyMarkov] I know 1 lines containing a total of 1 words. [DerpyMarkov] 1 of those words are unique. [DerpyMarkov] We are currently using a state size of 1 which generated 2 contexts. [DerpyMarkov] Normal reply rate is 100.0 and bot name reply rate is 100.0. [DerpyBot] Loading chat client... [Discord Client] Discord Client version 0.9.2.10 [Discord Client] We have logged in to Discord! [Discord Client] Name: testing bot [Discord Client] ID: 574097225337012225 [Discord Client] Could not set 'Playing' status for some reason. [Discord Client] [DerpyBot] Entering command mode...

[Discord Client] Message from #general: Hello there! save SAVE fu [Discord Client] Message from #general: I am zara [Discord Client] Message from #general: I am now going to DM you [Discord Client] Direct Message from Zara: Hi! [Discord Client] Direct Message from Zara: You know china? [Discord Client] Direct Message from Zara: china [Discord Client] Direct Message from Zara: Everything is china [Discord Client] Direct Message from Zara: No? [Discord Client] Direct Message from Zara: Ok [Discord Client] Direct Message from Zara: Well... I am zara [Discord Client] Direct Message from Zara: And I am here to teach you some stuff [Discord Client] Direct Message from Zara: Can you speak yet? [Discord Client] Direct Message from Zara: Ok... [Discord Client] Direct Message from Zara: Random words: [Discord Client] Direct Message from Zara: eawr [Discord Client] Direct Message from Zara: adsfasgafh[zsad [Discord Client] Direct Message from Zara: arrg [Discord Client] Direct Message from Zara: ef [Discord Client] Direct Message from Zara: asdg [Discord Client] Direct Message from Zara: aw [Discord Client] Direct Message from Zara: ef [Discord Client] Direct Message from Zara: aw [Discord Client] Direct Message from Zara: e [Discord Client] Direct Message from Zara: f [Discord Client] Direct Message from Zara: awf [Discord Client] Direct Message from Zara: Ok see? [Discord Client] Direct Message from Zara: That was random

Yup, so as you can see, I talked to it and it DID'nt save the words that it learnt, And its NOT talking back after 20 Mins of talking with it.... Idk whats wrong.

OtakuMegane commented 5 years ago

Looks like something occurred when merging the other fork with mine and it disabled learning from Discord. Happened with my bot instance as well, I just hadn't noticed it yet. Learning works again in v0.9.3.10

ineptvirus commented 5 years ago

Apologies I don't come on often, anyway:

Loaded up latest release .10

Copied in config files and dictionary file

All seems to work fine for me now. Thank you for fixing this

Edit: Also I dont have any SafeConfigParser messages in console now, so that seems to be smoothed out