F
F
FloppaPelmeni2021-10-04 23:39:44
Bots
FloppaPelmeni, 2021-10-04 23:39:44

How to make a bot ban users who are in its database?

Is it possible to somehow implement a bot that will ban users who are in its database?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vindicar, 2021-10-05
@FloppaPelmeni

It is possible if the bot has the appropriate rights on the server.
Well, since I corrected the question, I will correct the answer:
1. You read the table in the database where the users to be banned are stored. Working with the database is a separate story, read about the sqlite3 module and something on the basics of SQL.
2. Read the list of banned servers to determine who is already banned.
3. You define those who are not banned yet, but who need to be banned.
4. Banish. You can use Guild.ban() or Member.ban()

N
Nikolay Savelyev, 2021-10-05
@AgentSmith

yes you can if you have access to the database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question