Y
Y
yahabrovec2019-12-14 22:05:57
Python
yahabrovec, 2019-12-14 22:05:57

Synchronous python library for discord?

Hello.
Bot. Its whole point is to simply change the roles of users on the channel in the discord.
The discord.py library is asynchronous. It works on callbacks, as I understand it, and returns an event when an event occurs on the channel.
I just need to change user roles regardless of what happens. Something like:

def change_role(user_id , new_role):
    """Some code"""

I didn’t understand how this can be implemented by reading the documentation, but I couldn’t find ready-made solutions on the Internet. Maybe someone knows.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sergeo1, 2020-01-05
@sergeo1

Hello, the library provides a special task class with a loop decorator:
Here is a video where this is done:
https://www.youtube.com/watch?v=RK8RzuUMYt8
Here is a link to this module in the documentation:
https://discordpy.readthedocs. io/en/latest/ext/tas...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question