Example Bot is not working #7

Closed
opened 2026-02-15 23:16:12 -05:00 by yindo · 9 comments
Owner

Originally created by @martinbndr on GitHub (Mar 8, 2022).

Describe the bug
The default Bot example does not work. I installed everything like it has to be

To Reproduce

  • create a virtualenv
  • install revolt.py
  • paste in the example Bot
  • Start the bot

Expected behavior
!hello should force the bot to respond with "hi how are you"

Screenshots
image

Error:

python.exe c:/Users/MB/Documents/PythonBots/revoltchat/test/main.py
Task exception was never retrieved
future: <Task finished name='Task-15' coro=<Client.on_message() done, defined at c:\Users\MB\Documents\PythonBots\revoltchat\test\main.py:6> exception=TypeError("object str can't be used in 'await' expression")>
Traceback (most recent call last):
  File "c:\Users\MB\Documents\PythonBots\revoltchat\test\main.py", line 8, in on_message
    await message.channel.send("hi how are you")
  File "C:\Users\MB\Documents\PythonBots\revoltchat\test\env\lib\site-packages\revolt\messageable.py", line 60, in send   
    message = await self.state.http.send_message(await self._get_channel_id(), content, embed_payload, attachments, reply_payload, masquerade_payload)
TypeError: object str can't be used in 'await' expression

Library version
Access this info via pip show revolt.py
0.1.6

Additional context
Add any other context about the problem here.

Originally created by @martinbndr on GitHub (Mar 8, 2022). **Describe the bug** The default Bot example does not work. I installed everything like it has to be **To Reproduce** - create a virtualenv - install revolt.py - paste in the example Bot - Start the bot **Expected behavior** !hello should force the bot to respond with "hi how are you" **Screenshots** ![image](https://user-images.githubusercontent.com/55140357/157309440-9cb3266c-1ef5-4e58-93b1-d65d1ec80639.png) Error: ``` python.exe c:/Users/MB/Documents/PythonBots/revoltchat/test/main.py Task exception was never retrieved future: <Task finished name='Task-15' coro=<Client.on_message() done, defined at c:\Users\MB\Documents\PythonBots\revoltchat\test\main.py:6> exception=TypeError("object str can't be used in 'await' expression")> Traceback (most recent call last): File "c:\Users\MB\Documents\PythonBots\revoltchat\test\main.py", line 8, in on_message await message.channel.send("hi how are you") File "C:\Users\MB\Documents\PythonBots\revoltchat\test\env\lib\site-packages\revolt\messageable.py", line 60, in send message = await self.state.http.send_message(await self._get_channel_id(), content, embed_payload, attachments, reply_payload, masquerade_payload) TypeError: object str can't be used in 'await' expression ``` **Library version** Access this info via `pip show revolt.py` 0.1.6 **Additional context** Add any other context about the problem here.
yindo closed this issue 2026-02-15 23:16:12 -05:00
Author
Owner

@justamirror commented on GitHub (Apr 20, 2022):

about this issue, its the same here, and i checked. somehow the "_get_channel_id" prop of the TextChannel is not a async function

message = await self.state.http.send_message(await self._get_channel_id(), content, embed_payload, attachments, reply_payload, masquerade_payload)

@justamirror commented on GitHub (Apr 20, 2022): about this issue, its the same here, and i checked. somehow the "_get_channel_id" prop of the TextChannel is not a async function message = await self.state.http.send_message(_**await self._get_channel_id()**_, content, embed_payload, attachments, reply_payload, masquerade_payload)
Author
Owner

@justamirror commented on GitHub (Apr 20, 2022):

why does it use that anyway????? the _get_channel_id() function just returns self.id

@justamirror commented on GitHub (Apr 20, 2022): why does it use that anyway????? the _get_channel_id() function just returns self.id
Author
Owner

@Zomatree commented on GitHub (Apr 20, 2022):

This is fixed on master already.

@Zomatree commented on GitHub (Apr 20, 2022): This is fixed on master already.
Author
Owner

@justamirror commented on GitHub (Apr 20, 2022):

no it isnt?????
i literally JUST tried to update and its alllll up to date

@justamirror commented on GitHub (Apr 20, 2022): no it isnt????? i literally JUST tried to update and its alllll up to date
Author
Owner

@justamirror commented on GitHub (Apr 20, 2022):

unless my pip is being nuts

@justamirror commented on GitHub (Apr 20, 2022): unless my pip is being nuts
Author
Owner

@justamirror commented on GitHub (Apr 20, 2022):

and of course
it doesnt work
the exact same error

@justamirror commented on GitHub (Apr 20, 2022): and of course it doesnt work the exact same error
Author
Owner

@justamirror commented on GitHub (Apr 20, 2022):

ru SURE you pushed the change to pip

@justamirror commented on GitHub (Apr 20, 2022): ru SURE you pushed the change to pip
Author
Owner

@justamirror commented on GitHub (Apr 20, 2022):

@Zomatree

@justamirror commented on GitHub (Apr 20, 2022): @Zomatree
Author
Owner

@Zomatree commented on GitHub (Apr 20, 2022):

This is fixed on revolt.py@master, Its not in a release or on PyPi yet.

@Zomatree commented on GitHub (Apr 20, 2022): This is fixed on revolt.py@master, Its not in a release or on PyPi yet.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/python-client-sdk#7