Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'bool' object has no attribute 'set' #50

Open
ineptvirus opened this issue Apr 15, 2019 · 1 comment
Open

AttributeError: 'bool' object has no attribute 'set' #50

ineptvirus opened this issue Apr 15, 2019 · 1 comment

Comments

@ineptvirus
Copy link

Hi, firstly apologies because I hate to create issues, but I cant seem to fix this error by myself. I'm a bit of a noob.

It seems to finish loading and display the graphical info on training stats in the console, but after a few seconds another message appears that seems to be an error that stops the bot from working correctly.

Using Python 3.7, all modules installed and updated, on discord.

Console:

D:\Mirai\armchair-expert-master>c:\Users\Jake\AppData\Local\Programs\Python\Python37\python.exe D:\Mirai\armchair-expert-master\armchair_expert.py
INFO:ArmchairExpert:Status: STARTING_UP
INFO:ArmchairExpert:Loaded Discord Connector.
INFO:ArmchairExpert:Loading spaCy model
INFO:ArmchairExpert:Training begin
INFO:ArmchairExpert:Training_Preprocessing_Markov(Import)
INFO:ArmchairExpert:Training_Preprocessing_Markov(Discord)
INFO:ArmchairExpert:Training(Markov)
INFO:ArmchairExpert:Training_Preprocessing_Structure(Import)
INFO:ArmchairExpert:Training_Preprocessing_Structure(Discord)
INFO:ArmchairExpert:Training(Structure)
Using TensorFlow backend.
Using TensorFlow backend.
WARNING:tensorflow:From c:\Users\Jake\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From c:\Users\Jake\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\backend\tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
INFO:ArmchairExpert:Training end
INFO:ArmchairExpert:Status: RUNNING
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
embedding_1 (Embedding)      (None, 16, 120)           14400
_________________________________________________________________
lstm_1 (LSTM)                (None, 128)               127488
_________________________________________________________________
dense_1 (Dense)              (None, 120)               15480
=================================================================
Total params: 157,368
Trainable params: 157,368
Non-trainable params: 0
_________________________________________________________________
Task exception was never retrieved
future: <Task finished coro=<ConnectionState._delay_ready() done, defined at c:\Users\Jake\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\state.py:286> exception=AttributeError("'bool' object has no attribute 'set'")>
Traceback (most recent call last):
  File "c:\Users\Jake\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\state.py", line 322, in _delay_ready
    self.call_handlers('ready')
  File "c:\Users\Jake\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\state.py", line 139, in call_handlers
    func(*args, **kwargs)
  File "c:\Users\Jake\AppData\Local\Programs\Python\Python37\lib\site-packages\discord\client.py", line 207, in _handle_ready
    self._ready.set()
AttributeError: 'bool' object has no attribute 'set'

After this the bot still appears to be online, and direct messaging it yields further console text every time a message is sent, either direct or in a dm:

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\armchair-expert-master\connectors\discord.py", line 54, in on_message
    if message.server is None and DISCORD_LEARN_FROM_DIRECT_MESSAGE:
AttributeError: 'Message' object has no attribute 'server'

The bot never sends any messages out to discord. :(

Thanks,
-I.V.

@JacobMrox
Copy link

JacobMrox commented Apr 27, 2019

I'm having the same issue as well...

Edit: I was using discord rewrite, so I had to rewrite parts of the bot's code (the parts that generated these errors, for example, message.server is message.guild in the rewrite branch and so on) and it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants