N
N
Nolrox2022-02-08 14:55:50
Python
Nolrox, 2022-02-08 14:55:50

How to make discord.py bot remember role id?

I need to make the bot remember the id of the mute role that the server admins set. The fact is that I want the bot to be able to be added to their servers, and there, on each server, set their own role of the mute. If you make one variable in the bot, then there will be the same ID for all servers. And it will also be reset when the bot is restarted. Can someone help? (discord.py)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2022-02-08
@Nolrox

Make storage like "server id - role id", like a dictionary. You can save this dictionary to a file (for example, using json), or to a database every time you change the settings, and load it when the bot starts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question