-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
667 lines (597 loc) · 28.6 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
import discord
from discord import app_commands
from discord.ext import commands
import os
from keep_alive import keep_alive
from db import Save
from data import db
import asyncio
bot = commands.Bot(command_prefix="$", intents=discord.Intents.all())
@bot.event
async def on_ready():
print("Logged in.")
try:
synced = await bot.tree.sync()
print(f"Synced {len(synced)} command(s)")
except Exception as e:
print(e)
@bot.event
async def on_guild_join(guild):
db[guild.id] = {"name": guild.name, "id": guild.id, "channels": {}}
for channel in guild.channels:
db[guild.id]["channels"][channel.id] = {
"name": channel.name,
"id": channel.id,
"whitelisted": {},
"blacklist": {},
"whiteliston": False
}
Save(db)
@bot.event
async def on_guild_channel_update(before, channel):
if before.name != channel.name:
db[channel.guild.id]["channels"][channel.id]["name"] = channel.name
Save(db)
@bot.event
async def on_guild_remove(guild):
del db[guild.id]
Save(db)
@bot.event
async def on_guild_channel_create(channel):
db[channel.guild.id]["channels"][channel.id] = {
"name": channel.name,
"id": channel.id,
"whitelisted": {},
"blacklist": {},
"whiteliston": False
}
Save(db)
@bot.event
async def on_guild_channel_delete(channel):
del db[channel.guild.id]["channels"][channel.id]
Save(db)
@bot.event
async def on_message(message):
# Ignore messages from the bot itself to avoid potential infinite loops
if message.author == bot.user:
return
channel = message.channel
channelId = channel.id
if (db[message.guild.id]["channels"][channelId]["whiteliston"] == True):
print(message.author.id in db[message.guild.id]["channels"][channelId]
["whitelisted"])
if (message.author.id not in db[message.guild.id]["channels"]
[channelId]["whitelisted"]):
await message.delete()
embed = discord.Embed(
title=f"You are not whitelisted in this channel.",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await message.author.send(embed=embed)
if (message.author.id
in db[message.guild.id]["channels"][channelId]["blacklist"]):
await message.delete()
embed = discord.Embed(title=f"You are blacklisted in this channel.",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(text="- Whitelists & Blacklists (made by PlotTwist)")
await message.author.send(embed=embed)
### Commands:
@bot.tree.command(name="help")
@app_commands.describe()
async def help(interaction: discord.Interaction):
embed = discord.Embed(title="Whitelists & Blacklists Commands:")
embed.add_field(
name="General Commands:",
value=
"1. /viewlists | Sees who is in the whitelist and blacklist.\n2. /help | Shows this message.",
inline=False)
embed.add_field(
name="Whitelist Commands:",
value=
"1. /whiteliston | Turns on the whitelist in the channel used so that only whitelisted users can type in there. Only works if the whitelist is off. Only works if there is at least 1 person whitelisted. Can only be used by whitelisted users.\n2. /whitelistoff | Turns off the whitelist in the channel used so that anyone can type in there. Only works if the whitelist is on. Can only be used by whitelisted users.\n3. /addwhitelist [user] | Adds a user to the whitelist. If the whitelist is off and no users whitelisted, any admin can use it (may instead use a whitelist role). If whitelist is on or there are users whitelisted, can only be used by whitelisted users.\n4. /removewhitelist [user] | Removes a user from the whitelist. If there are users whitelisted they are the only people who can use this. If not, can't be used. If it makes there be no whitelisted users, it also turns off the whitelist.",
inline=False)
embed.add_field(
name="Blacklist Commands:",
value=
"1. /addblacklist [user] | Adds a user to the blacklist. Can only be used by admins if there arent any whitelisted users, if there are, can only be used by them.\n2. /removeblacklist [user] | Removes a user from the blacklist. Can only be used by admins if there aren't any whitelisted users, if there are, can only be used by them.\n3. /tempblacklist [user] [time] | Temporarily blacklists a user for the provided time. d for days, h for hours, m for minutes, and s for seconds. Also follows the same rules as add and remove from blacklist on who can use it. Example: /tempblacklist @bob 10m 30s",
inline=False)
await interaction.response.send_message(embed=embed, ephemeral=True)
@bot.tree.command(name="whiteliston")
@app_commands.describe()
async def whiteliston(interaction: discord.Interaction):
channel = interaction.channel
channelId = channel.id
if (db[interaction.guild.id]["channels"][channelId]["whitelisted"] == {}):
embed = discord.Embed(title=f"No users whitelisted, use /addwhitelist",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed, ephemeral=True)
else:
if (db[interaction.guild.id]["channels"][channelId]["whiteliston"] ==
False):
if (interaction.user.id in db[interaction.guild.id]["channels"]
[channelId]["whitelisted"]):
db[interaction.guild.
id]["channels"][channelId]["whiteliston"] = True
embed = discord.Embed(title=f"Turned the whitelist on.",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=f"You must be whitelisted to run this command.",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(title=f"Whitelist already on.",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
Save(db)
@bot.tree.command(name="whitelistoff")
@app_commands.describe()
async def whitelistoff(interaction: discord.Interaction, ):
channel = interaction.channel
channelId = channel.id
if (db[interaction.guild.id]["channels"][channelId]["whitelisted"] == {}):
embed = discord.Embed(title=f"No users whitelisted, use /addwhitelist",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed, ephemeral=True)
else:
if (db[interaction.guild.id]["channels"][channelId]["whiteliston"] ==
True):
if (interaction.user.id in db[interaction.guild.id]["channels"]
[channelId]["whitelisted"]):
db[interaction.guild.
id]["channels"][channelId]["whiteliston"] = False
embed = discord.Embed(title=f"Turned the whitelist off.",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=f"You must be whitelisted to run this command.",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(title=f"Whitelist already off.",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
Save(db)
@bot.tree.command(name="addwhitelist")
@app_commands.describe(user="The user you want to add to the whitelist")
async def addwhitelist(interaction: discord.Interaction, user: discord.Member):
channel = interaction.channel
channelId = channel.id
if (db[interaction.guild.id]["channels"][channelId]["whitelisted"] == {}):
if (interaction.user.guild_permissions.administrator):
db[interaction.guild.id]["channels"][channelId]["whitelisted"][
user.id] = {
"name": user.name,
"id": user.id
}
embed = discord.Embed(title=f"Added {user.name} to whitelist",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=
f"You don't have the necissary permissions to run this. (Must have Administrator.)",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
if (interaction.user.id in db[interaction.guild.id]["channels"]
[channelId]["whitelisted"]):
db[interaction.guild.id]["channels"][channelId]["whitelisted"][
user.id] = {
"name": user.name,
"id": user.id
}
embed = discord.Embed(title=f"Added {user.name} to whitelist",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=
f"You must be whitelisted to run this command while users are whitelisted.",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
Save(db)
@bot.tree.command(name="removewhitelist")
@app_commands.describe(user="The user you want to remove from the whitelist")
async def removewhitelist(interaction: discord.Interaction,
user: discord.Member):
channel = interaction.channel
channelId = channel.id
if (db[interaction.guild.id]["channels"][channelId]["whitelisted"] == {}):
if (interaction.user.guild_permissions.administrator):
if (user.id in db[interaction.guild.id]["channels"][channelId]
["whitelisted"]):
del db[interaction.guild.
id]["channels"][channelId]["whitelisted"][user.id]
embed = discord.Embed(
title=f"Removed {user.name} from whitelist",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=f"{user.name} isn't whitelisted here",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=
f"You don't have the necissary permissions to run this. (Must have Administrator.)",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
if (interaction.user.id in db[interaction.guild.id]["channels"]
[channelId]["whitelisted"]):
if (user.id in db[interaction.guild.id]["channels"][channelId]
["whitelisted"]):
del db[interaction.guild.
id]["channels"][channelId]["whitelisted"][user.id]
embed = discord.Embed(
title=f"Removed {user.name} from whitelist",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=f"{user.name} isn't whitelisted here",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=
f"You must be whitelisted to run this command while users are whitelisted.",
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
Save(db)
@bot.tree.command(name="viewlists")
@app_commands.describe()
async def viewlists(interaction: discord.Interaction):
channel = interaction.channel
channelId = channel.id
whitelisted = db[
interaction.guild.id]["channels"][channelId]["whitelisted"]
message = ""
for userId in whitelisted:
message += " - " + whitelisted[userId]["name"] + "\n"
embed = discord.Embed(
title=f"Whitelisted Users in {interaction.channel.name}:",
description=message,
color=0x007063)
embed.set_author(name="Whitelist")
embed.set_footer(text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.user.send(embed=embed)
channel = interaction.channel
channelId = channel.id
blacklisted = db[interaction.guild.id]["channels"][channelId]["blacklist"]
message = ""
for userId in blacklisted:
message += " - " + blacklisted[userId]["name"] + "\n"
embed = discord.Embed(
title=f"Blacklisted Users in {interaction.channel.name}:",
description=message,
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.user.send(embed=embed)
await interaction.response.send_message("Sent the information is dms.",
ephemeral=True)
@bot.tree.command(name="addblacklist")
@app_commands.describe(user="The user you want to add to the blacklist")
async def addblacklist(interaction: discord.Interaction, user: discord.Member):
channel = interaction.channel
channelId = channel.id
if (db[interaction.guild.id]["channels"][channelId]["whitelisted"] == {}):
if (interaction.user.guild_permissions.administrator):
db[interaction.guild.id]["channels"][channelId]["blacklist"][
user.id] = {
"name": user.name,
"id": user.id
}
embed = discord.Embed(title=f"Added {user.name} to blacklist",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=
f"You don't have the necissary permissions to run this. (Must have Administrator.)",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
if (interaction.user.id in db[interaction.guild.id]["channels"]
[channelId]["whitelisted"]):
db[interaction.guild.id]["channels"][channelId]["blacklist"][
user.id] = {
"name": user.name,
"id": user.id
}
embed = discord.Embed(title=f"Added {user.name} to blacklist",
color=0x007063)
embed.set_author(name="blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=
f"You must be whitelisted to run this command while users are whitelisted.",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
Save(db)
def convert_time_to_seconds(time_str):
time_units = {"d": 86400, "h": 3600, "m": 60, "s": 1}
total_seconds = 0
current_number = ''
for char in time_str:
if char.isdigit():
current_number += char
elif char in time_units:
total_seconds += int(current_number) * time_units[char]
current_number = ''
# Add any remaining number (if time_str ends with a number without a unit)
if current_number:
total_seconds += int(current_number)
return total_seconds
@bot.tree.command(name="tempblacklist")
@app_commands.describe(user="The user you want to add to the blacklist",
time="The time you want them blacklisted for. d for days, h for hours, m for minutes, and s for seconds.")
async def tempblacklist(interaction: discord.Interaction, user: discord.Member,
time: str):
channel = interaction.channel
channelId = channel.id
tempmute = convert_time_to_seconds(time)
if (db[interaction.guild.id]["channels"][channelId]["whitelisted"] == {}):
if (interaction.user.guild_permissions.administrator):
db[interaction.guild.id]["channels"][channelId]["blacklist"][
user.id] = {
"name": user.name,
"id": user.id
}
embed = discord.Embed(
title=f"Added {user.name} to blacklist for {time}.",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
Save(db)
print(tempmute)
await asyncio.sleep(tempmute)
print("Finished")
del db[interaction.guild.id]["channels"][channelId]["blacklist"][
user.id]
embed = discord.Embed(title=f"Removed {user.name} from blacklist",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.user.send(embed=embed)
else:
embed = discord.Embed(
title=
f"You don't have the necissary permissions to run this. (Must have Administrator.)",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
if (interaction.user.id in db[interaction.guild.id]["channels"]
[channelId]["whitelisted"]):
db[interaction.guild.id]["channels"][channelId]["blacklist"][
user.id] = {
"name": user.name,
"id": user.id
}
embed = discord.Embed(
title=f"Added {user.name} to blacklist for {time}.",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
Save(db)
print(tempmute)
await asyncio.sleep(tempmute)
print("Finished")
del db[interaction.guild.id]["channels"][channelId]["blacklist"][
user.id]
embed = discord.Embed(title=f"Removed {user.name} from blacklist",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.user.send(embed=embed)
else:
embed = discord.Embed(
title=
f"You must be whitelisted to run this command while users are whitelisted.",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
Save(db)
@bot.tree.command(name="removeblacklist")
@app_commands.describe(user="The user you want to remove from the blacklist")
async def removeblacklist(interaction: discord.Interaction,
user: discord.Member):
channel = interaction.channel
channelId = channel.id
if (db[interaction.guild.id]["channels"][channelId]["whitelisted"] == {}):
if (interaction.user.guild_permissions.administrator):
if (user.id in db[interaction.guild.id]["channels"][channelId]
["blacklist"]):
del db[interaction.guild.
id]["channels"][channelId]["blacklist"][user.id]
embed = discord.Embed(
title=f"Removed {user.name} from blacklist",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=f"{user.name} isn't blacklisted here",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=
f"You don't have the necissary permissions to run this. (Must have Administrator.)",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
if (interaction.user.id in db[interaction.guild.id]["channels"]
[channelId]["whitelisted"]):
if (user.id in db[interaction.guild.id]["channels"][channelId]
["blacklist"]):
del db[interaction.guild.
id]["channels"][channelId]["blacklist"][user.id]
embed = discord.Embed(
title=f"Removed {user.name} from blacklist",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=f"{user.name} isn't blacklisted here",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
else:
embed = discord.Embed(
title=
f"You must be whitelisted to run this command while users are whitelisted.",
color=0x007063)
embed.set_author(name="Blacklist")
embed.set_footer(
text="- Whitelists & Blacklists (made by PlotTwist)")
await interaction.response.send_message(embed=embed,
ephemeral=True)
Save(db)
'''
Example Command:
@bot.tree.command(name="setinfo")
@app_commands.describe(id="Id for this info", message="The message")
async def setInfo(interaction: discord.Interaction, id: int, message: str):
if interaction.user.guild_permissions.administrator:
if (id not in db.keys()):
db[id] = message
await interaction.response.send_message(
f"You have set the /info with the id of {id} to {message}",
ephemeral=True)
Save(db)
else:
await interaction.response.send_message(
f"This is already an info, to edit it, do /editInfo",
ephemeral=True)
else:
await interaction.response.send_message(
f"You don't have the perms to do this.", ephemeral=True)
'''
keep_alive()
bot.run(os.environ['TOKEN'])