-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathverify-public.py
5657 lines (5331 loc) · 283 KB
/
verify-public.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
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import disnake as discord
from disnake.ext import commands
import asyncio
import random
import traceback
from sys import getsizeof
import sys
import aiohttp, json, subprocess
global add_lock
global v2
global code
global unverify_lock
global local_verification
global local_verify_message
global db_channel_obj
global ready
global db_channel_obj6
global banned_server
global banned_server_obj
global local_verified_roles
global local_verified_roles_obj
global local_not_verified_roles
global local_not_verified_roles_obj
global banned_users
global s_code
global neustarttimer
global savedata
global verify_role_cache
global everyone_cache
everyone_cache = {}
verify_role_cache = {}
savedata = {}
s_code = ""
banned_users = []
banned_server_obj = []
banned_server = []
ready = False
db_channel_obj = []
db_channel_obj6 = []
local_verification = []
local_verify_message = []
local_verified_roles = []
local_verified_roles_obj = []
local_not_verified_roles = []
local_not_verified_roles_obj = []
add_lock = []
unverify_lock = []
global sp
sp = []
global ssave
ssave = ""
code = {}
v2 = {}
membercache = discord.MemberCacheFlags.none()
intents = discord.Intents.default()
intents.members = True
all_intents = []
if intents.bans:
all_intents.append("bans = True")
else:
all_intents.append("bans = False")
if intents.dm_messages:
all_intents.append("dm_messages = True")
else:
all_intents.append("dm_messages = False")
if intents.dm_reactions:
all_intents.append("dm_reactions = True")
else:
all_intents.append("dm_reactions = False")
if intents.dm_typing:
all_intents.append("dm_typing = True")
else:
all_intents.append("dm_typing = False")
if intents.emojis:
all_intents.append("emojis = True")
else:
all_intents.append("emojis = False")
if intents.guild_messages:
all_intents.append("guild_messages = True")
else:
all_intents.append("guild_messages = False")
if intents.guild_reactions:
all_intents.append("guild_reactions = True")
else:
all_intents.append("guild_reactions = False")
if intents.guild_typing:
all_intents.append("guild_typing = True")
else:
all_intents.append("guild_typing = False")
if intents.guilds:
all_intents.append("guilds = True")
else:
all_intents.append("guilds = False")
if intents.integrations:
all_intents.append("integrations = True")
else:
all_intents.append("integrations = False")
if intents.invites:
all_intents.append("invites = True")
else:
all_intents.append("invites = False")
if intents.members:
all_intents.append("members = True")
else:
all_intents.append("members = False")
if intents.messages:
all_intents.append("messages = True")
else:
all_intents.append("messages = False")
if intents.presences:
all_intents.append("presences = True")
else:
all_intents.append("presences = False")
if intents.reactions:
all_intents.append("reactions = True")
else:
all_intents.append("reactions = False")
if intents.typing:
all_intents.append("typing = True")
else:
all_intents.append("typing = False")
if intents.value:
all_intents.append("value = True")
else:
all_intents.append("value = False")
if intents.voice_states:
all_intents.append("voice_states = True")
else:
all_intents.append("voice_states = False")
if intents.webhooks:
all_intents.append("webhooks = True")
else:
all_intents.append("webhooks = False")
print(f"Intents: {all_intents}\n")
client = commands.AutoShardedBot(command_prefix=discord.ext.commands.when_mentioned, intents=intents, chunk_guilds_at_startup=False, member_cache_flags=membercache, max_messages=5, test_guilds=[714819340788301934])
############################################
# Change variables here:
# Set the bot ADMINS; They have acess to special commands and are excluded from MAINTENANCE mode. They can also answer in DM-Support
ADMINS = [513071093976793099]
# When a support message contains one of these words, it will be marked as spam
CHAT_FILTER = ["idiot", "ideot", "lächerlich", "behindert", "toxic", "noob", "arsch", "ehrenlos", "skilllos", "scheiß", "fresse", "kak", "kack", "rumheulen", "rip", "wichser", "wichsen", "arschloch", "sex", "bastard", "arschgesicht", "scheißkopf", "verpiss", "anal", "anus", "arse", "assfuck", "asshole", "assfucker", "asshole", "assshole", "bastard", "bitch", "bloodyhell", "cockfucker", "cocksuck", "cocksucker", "coonnass", "douche", "erect", "erection", "erotic", "escort", "fuckoff", "fuckyou", "fuckass", "fuckhole", "goddamn", "homoerotic", "lesbian", "lesbians", "motherfucker", "motherfuck", "nigger", "penis", "penisfucker", "pissoff", "porn", "porno", "pornography", "pussy", "retard", "sadist", "sexy", "sonofabitch", "tits", "naked", "nackte", "nackt", "nackten", "schei0", "ar***", "scheiss", "kacke", "fick", "oasch", "drecksau", "saubeutel", "drecksack", "wixxe", "wichse", "sackgesicht", "spasst", "spast", "deimudda", "deinemudda", "deinemutter", "deimutter", "spasti", "spacko", "spakko", "hackfresse", "pansen", "natursekt", "naturkaviar", "klitoris", "vagina", "titte", "pimmel", "puller", "schlampe", "fotze", "hure", "nutte", "beidl", "moese", "schwuchtel", "lesbe", "schwul", "schwuchtl", "schwuchtel", "lesbisch", "muschi", "stricher", "sperm", "homos", "hoden", "sex", "pedophil", "pedofil", "jihad", "dschihad", "gulag", "tschusch", "neger", "nigger", "bimbo", "kanake", "kanacke", "kannacke", "muselmann", "itacker", "itaka", "polack", "kkk", "kukluxklan", "itaker", "kuemmeltuerk", "chinafarmer", "reisfresser", "kokain", "koks", "xtasy", "ecstasy", "marihuana", "mariwana", "mariwanna", "hasch", "cannabis", "moepse", "moese", "moeppse", "kloeten", "kinderschaender", "scheiss", "arsch", "bumsen", "abortion", "analingus", "anus", "anuses", "arse", "arsehole", "arseraper", "arserapist", "aryan", "asscrack", "ass", "asses", "asspirate", "asswipe", "ballbuster", "ballbreaker", "ballsack", "bastard", "beaver", "bestiality", "beastiality", "beeyotch", "biatch", "bitch", "blowjob", "blueball", "bollock", "bollox", "boner", "boners", "booty", "bunghole", "butthole", "canabis", "cannabis", "chlamydia", "choad", "chode", "circle", "jerk", "cocaine", "colostomy", "constipat", "cottonpicker", "crackhead", "creaming", "cum", "cumbucket", "cumguzzler", "cumshot", "cunniling", "cunt", "darkie", "darky", "daterape", "deepthroat", "defecat", "deficat", "dildo", "dingleberr", "doggiestyle", "doggystyle", "donkeypunch", "dookie", "doosh", "douch", "doush", "ejaculat", "enema", "erectile", "erection", "fag", "fart", "farts", "fcuk", "fecal", "feces", "felch", "fellat", "fetus", "foetus", "fisting", "fook", "foreskin", "frontbum", "fudgepacker", "funbags", "furburger", "furryburger", "gangbang", "gangrape", "ganja", "genital", "gloryhole", "goatse", "goldenshower", "gonorhea", "gonorrhoea", "gonad", "handjob", "heroin", "hemorrhoid", "haemorrhoid", "herpes", "hoebag", "honkie", "honky", "hooker", "hooter", "hotcarl", "hymen", "jackoff", "jerkoff", "jigabo", "jihad", "jism", "jizz", "juggs", "klit", "lemonparty", "mangina", "manjuice", "marijuana", "masturbat", "maxipad", "milf", "molester", "molestor", "muffbomb", "muffdiv", "nads", "necroped", "necrophil", "negro", "negroes", "niglet", "nippl", "nobgoblin", "numbnut", "nutsack", "nutted", "orgasm", "paedophile", "pedofile", "pedophile", "penis", "pillowbiter", "piss", "pootang", "poontang", "porn", "pussy", "queef", "queer", "raghead", "rapist", "rapists", "reacharound", "rectal", "rectum", "reefer", "retard", "rimjob", "rugmunch", "rumprider", "schlong", "secks", "sex", "shemale", "shlong", "skinflute", "slanteyes", "slut", "sperm", "sphincter", "spliff", "joint", "strapon", "swampass", "sybian", "syphil", "taliban", "tampax", "tampon", "tarbaby", "teabag", "testic", "tightass", "tits", "tittie", "titty", "tosser", "towelhead", "tranny", "tubgirl", "twat", "urinat", "vagina", "vajina", "vajayjay", "vibrater", "vibrator", "whitie", "whore", "wrecktum", "zipperhead"]
# When !clean gets executed, the bot will stay on these servers, even when the bot is not in use there
ALLOWED_SERVERS = [ENTER SERVER-IDS HERE]
# Set to true to enable MAINTENANCE mode. Will set the bot's status to "MAINTENANCE" and users are no longer able to run commands
MAINTENANCE = True
# Set the DB Channel for banned users
BANNED_USERS_ID = ENTER CHANNEL-ID HERE
# Set the DB Channel for Verification-Channel and Server
VERIFY_CHANNEL_ID = ENTER CHANNEL-ID HERE
# Set the DB Channel for verify-message
MESSAGE_CHANNEL_ID = ENTER CHANNEL-ID HERE
# Set the DB Channel for banned servers
BANNS_CHANNEL_ID = ENTER CHANNEL-ID HERE
# Set the DB Channel for Verified roles
VERIFIED_ROLES_CHANNEL_ID = ENTER CHANNEL-ID HERE
# Log server joins/leaves
SERVER_JOIN_LEAVE_CHANNEL_ID = ENTER CHANNEL-ID HERE
# Log errors
ERROR_CHANNEL = ENTER CHANNEL-ID HERE
############################################
def sizeof_fmt(num, suffix='B'):
''' by Fred Cirera, https://stackoverflow.com/a/1094933/1870254, modified'''
for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']:
if abs(num) < 1024.0:
return "%3.1f %s%s" % (num, unit, suffix)
num /= 1024.0
return "%.1f %s%s" % (num, 'Yi', suffix)
async def clear():
while True:
global v2
global sp
global ssave
global code
code = {}
ssave = ""
v2 = {}
await asyncio.sleep(5000)
async def clearcache():
while True:
add_lock = []
await asyncio.sleep(300)
async def autoneustart():
await asyncio.sleep(43200)
print("Auto Neustart")
await client.close()
sys.exit()
@client.slash_command(name="help", description="Shows all commands", dm_permission=False)
async def help(interaction):
global s_code
global banned_users
global local_banned_users_obj
global banned_server
global banned_server_obj
global local_verify_message
global db_channel_obj6
global ready
await client.wait_until_ready()
global db_channel_obj
global ssave
global sp
global add_lock
global local_verification
global local_verified_roles
global local_verified_roles_obj
global local_not_verified_roles
global local_not_verified_roles_obj
embed = discord.Embed(title='Verification-Help', description='https://realygirllp.jimdofree.com/discord/verification-bot/', color=3566847)
embed.add_field(name="---", value="Admin-Commands", inline=False)
embed.add_field(name=f"/add-verification", value="Add the verification to the channel, where you run the command (makes it a verify-channel)", inline=False)
embed.add_field(name=f"/remove-channel", value="Remove the verification (verify-channel) from the channel, where you run the command. ", inline=False)
embed.add_field(name=f"/check-verify-channel", value="Checks if the channel, where you run the command is a verify-channel", inline=False)
embed.add_field(name=f"/check-verification", value="Checks whether errors occurred during the setup of the verification (or later) that could cause problems. You should run this command after !add-verification is finished. Note: Not every error is a problem!", inline=False)
embed.add_field(name=f"/verify-message", value="Customize the message, when a new user types !verify. You can include the code with {code}. Example: \"!verify-message Welcome to the Server! Please verify yourself with the code {code}\" ", inline=False)
embed.add_field(name=f"/mverify USER", value="Manually verify a user", inline=False)
embed.add_field(name=f"/unverify USER", value="Manually unverify a user", inline=False)
embed.add_field(name=f"---", value="User-Commands", inline=False)
embed.add_field(name=f"/verify", value="Generates a verification code. Only runs in verify-channel. Message with code will be deleted in 5 minutes.", inline=False)
embed.add_field(name=f"/verify [NUMBER]", value="Redeem a generated verification-code", inline=False)
embed.add_field(name=f"/help", value="Shows this message", inline=False)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This message is too long to send it as text. Please enable embeds on the server!", ehemeral=True)
class PermissionSelectEveryone(discord.ui.View):
options = [
discord.SelectOption(label="Don't change", description="Don't change permissions"),
discord.SelectOption(label="None", description="No permissions"),
discord.SelectOption(label='create_instant_invite', description='Add CREATE_INSTANT_INVITE permission'),
discord.SelectOption(label='add_reactions', description='Add ADD_REACTIONS permission'),
discord.SelectOption(label='view_channel', description='Add VIEW_CHANNEL permission'),
discord.SelectOption(label='send_messages', description='Add SEND_MESSAGES permission'),
discord.SelectOption(label='send_tts_messages', description='Add SEND_TTS_MESSAGES permission'),
discord.SelectOption(label='embed_links', description='Add EMBED_LINKS permission'),
discord.SelectOption(label='attach_files', description='Add ATTACH_FILES permission'),
discord.SelectOption(label='read_message_history', description='Add READ_MESSAGE_HISTORY permission'),
discord.SelectOption(label='mention_everyone', description='Add MENTION_EVERYONE permission'),
discord.SelectOption(label='use_external_emojis', description='Add USE_EXTERNAL_EMOJIS permission'),
discord.SelectOption(label='connect', description='Add CONNECT permission'),
discord.SelectOption(label='speak', description='Add SPEAK permission'),
discord.SelectOption(label='change_nickname', description='Add CHANGE_NICKNAME permission'),
discord.SelectOption(label='create_public_threads', description='Add CREATE_PUBLIC_THREADS permission'),
discord.SelectOption(label='create_private_threads', description='Add CREATE_PRIVATE_THREADS permission'),
discord.SelectOption(label='use_external_stickers', description='Add USE_EXTERNAL_STICKERS permission'),
discord.SelectOption(label='send_messages_in_threads', description='Add SEND_MESSAGES_IN_THREADS permission')
]
@discord.ui.select(placeholder='Select permissions', min_values=1, max_values=len(options), options=options)
async def sel(self, select: discord.ui.Select, interaction: discord.Interaction):
global verify_role_cache
global everyone_cache
selected = interaction.data.values
verified_role = verify_role_cache[str(interaction.guild.id)]
everyone_role = everyone_cache[str(interaction.guild.id)]
try:
await interaction.message.delete()
if "Don't change" in selected:
pass
else:
permissions = 0
if "create_instant_invite" in selected:
permissions += 1
if "add_reactions" in selected:
permissions += 64
if "view_channel" in selected:
permissions += 1024
if "send_messages" in selected:
permissions += 2048
if "send_tts_messages" in selected:
permissions += 4096
if "embed_links" in selected:
permissions += 16384
if "attach_files" in selected:
permissions += 32768
if "read_message_history" in selected:
permissions += 65536
if "mention_everyone" in selected:
permissions += 131072
if "use_external_emojis" in selected:
permissions += 262144
if "connect" in selected:
permissions += 1048576
if "speak" in selected:
permissions += 2097152
if "change_nickname" in selected:
permissions += 67108864
if "create_public_threads" in selected:
permissions += 34359738368
if "create_private_threads" in selected:
permissions += 68719476736
if "use_external_stickers" in selected:
permissions += 137438953472
if "send_messages_in_threads" in selected:
permissions += 274877906944
permission_overwrite = discord.Permissions(permissions=permissions+2147483648)
await everyone_role.edit(permissions=permission_overwrite)
await interaction.channel.set_permissions(everyone_role, overwrite=discord.PermissionOverwrite(read_messages=True, read_message_history=True, send_messages=True, use_slash_commands=True))
await interaction.channel.set_permissions(verified_role, overwrite=discord.PermissionOverwrite(read_messages=False, read_message_history=False, send_messages=False, use_slash_commands=True))
embed = discord.Embed(title=f"Setup done sucessfully!", description="This message will be automatically deleted in 5 seconds.", color=3566847)
await interaction.response.send_message(embed=embed, delete_after=5)
except:
embed = discord.Embed(title="I'm sorry, but I don't have permissions to change server/channel permissions.", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("I'm sorry, but I don't have permissions to change server/channel permissions.", ephemeral=True)
class PermissionSelectVerified(discord.ui.View):
options = [
discord.SelectOption(label="Don't change", description="Don't change permissions"),
discord.SelectOption(label="None", description="No permissions"),
discord.SelectOption(label='create_instant_invite', description='Add CREATE_INSTANT_INVITE permission'),
discord.SelectOption(label='add_reactions', description='Add ADD_REACTIONS permission'),
discord.SelectOption(label='view_channel', description='Add VIEW_CHANNEL permission'),
discord.SelectOption(label='send_messages', description='Add SEND_MESSAGES permission'),
discord.SelectOption(label='send_tts_messages', description='Add SEND_TTS_MESSAGES permission'),
discord.SelectOption(label='embed_links', description='Add EMBED_LINKS permission'),
discord.SelectOption(label='attach_files', description='Add ATTACH_FILES permission'),
discord.SelectOption(label='read_message_history', description='Add READ_MESSAGE_HISTORY permission'),
discord.SelectOption(label='mention_everyone', description='Add MENTION_EVERYONE permission'),
discord.SelectOption(label='use_external_emojis', description='Add USE_EXTERNAL_EMOJIS permission'),
discord.SelectOption(label='connect', description='Add CONNECT permission'),
discord.SelectOption(label='speak', description='Add SPEAK permission'),
discord.SelectOption(label='change_nickname', description='Add CHANGE_NICKNAME permission'),
discord.SelectOption(label='create_public_threads', description='Add CREATE_PUBLIC_THREADS permission'),
discord.SelectOption(label='create_private_threads', description='Add CREATE_PRIVATE_THREADS permission'),
discord.SelectOption(label='use_external_stickers', description='Add USE_EXTERNAL_STICKERS permission'),
discord.SelectOption(label='send_messages_in_threads', description='Add SEND_MESSAGES_IN_THREADS permission')
]
@discord.ui.select(placeholder='Select permissions', min_values=1, max_values=len(options), options=options)
async def sel(self, select: discord.ui.Select, interaction: discord.Interaction):
global verify_role_cache
global everyone_cache
selected = interaction.data.values
verified_role = verify_role_cache[str(interaction.guild.id)]
everyone_role = everyone_cache[str(interaction.guild.id)]
try:
await interaction.message.delete()
if "Don't change" in selected:
pass
else:
permissions = 0
if "create_instant_invite" in selected:
permissions += 1
if "add_reactions" in selected:
permissions += 64
if "view_channel" in selected:
permissions += 1024
if "send_messages" in selected:
permissions += 2048
if "send_tts_messages" in selected:
permissions += 4096
if "embed_links" in selected:
permissions += 16384
if "attach_files" in selected:
permissions += 32768
if "read_message_history" in selected:
permissions += 65536
if "mention_everyone" in selected:
permissions += 131072
if "use_external_emojis" in selected:
permissions += 262144
if "connect" in selected:
permissions += 1048576
if "speak" in selected:
permissions += 2097152
if "change_nickname" in selected:
permissions += 67108864
if "create_public_threads" in selected:
permissions += 34359738368
if "create_private_threads" in selected:
permissions += 68719476736
if "use_external_stickers" in selected:
permissions += 137438953472
if "send_messages_in_threads" in selected:
permissions += 274877906944
permission_overwrite = discord.Permissions(permissions=permissions+2147483648)
await verified_role.edit(permissions=permission_overwrite)
embed = discord.Embed(title=f"Select default permissions for \"{everyone_role.name}\"", description=f"You can select your default permissions for \"{everyone_role.name}\".", color=3566847)
await interaction.response.send_message(embed=embed, view=PermissionSelectEveryone())
except:
embed = discord.Embed(title="I'm sorry, but I don't have permissions to change server/channel permissions.", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("I'm sorry, but I don't have permissions to change server/channel permissions.", ephemeral=True)
@client.slash_command(name="setup", description="Setup for Verification-System", options=[discord.Option("verified_role", "Select your Verified-Role. Users will get it after they have verified.", discord.OptionType.role)], default_member_permissions=discord.Permissions(8), dm_permission=False)
async def setup(interaction, verified_role=None):
global s_code
global banned_users
global local_banned_users_obj
global banned_server
global banned_server_obj
global local_verify_message
global db_channel_obj6
global ready
await client.wait_until_ready()
global db_channel_obj
global ssave
global sp
global add_lock
global local_verification
global local_verified_roles
global local_verified_roles_obj
global local_not_verified_roles
global local_not_verified_roles_obj
global savedata
global verify_role_cache
global everyone_cache
if not ready:
embed = discord.Embed(title="The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", ephemeral=True)
return
if MAINTENANCE and not interaction.author.id in ADMINS:
embed = discord.Embed(title='This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_', color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_", ephemeral=True)
return
savedata[interaction.guild.id] = verified_role
perm = []
botperm = []
for i in interaction.author.guild_permissions:
perm.append(str(i))
for i in interaction.channel.guild.me.guild_permissions:
botperm.append(str(i))
user = interaction.author
if str("('administrator', True)") in perm or interaction.author.id in sp:
if verified_role is None:
try:
verified_role = await interaction.guild.create_role(name="Verified")
except:
embed = discord.Embed(title='Failed to create "Verified"-Role! Please ensure, that I have the manage_roles permission and try again!', color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message('Failed to create "Verified"-Role! Please ensure, that I have the manage_roles permission and try again!', ephemeral=True)
return
if True:
noverify = False
try:
exclude = []
excluded_channels = excluded_channels.replace(" ")
excludex = excluded_channels.split(",")
if not exclude is None:
for channel_id in excludex:
try:
c = client.get_channel(int(channel_id))
exclude.append(c)
except:
pass
except:
exclude = []
if interaction.guild.id in add_lock:
embed = discord.Embed(title='Please wait 5 minutes, until you run the command again.\n(Discord API restriction)', color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("Please wait 5 minutes, until you run the command again.\n(Discord API restriction)", ephemeral=True)
return
verify_role_cache[str(interaction.guild.id)] = verified_role
everyone_cache[str(interaction.guild.id)] = interaction.guild.default_role
if not str(interaction.guild.id) in local_verification:
msg = await client.get_channel(VERIFY_CHANNEL_ID).send(interaction.guild.id)
local_verification.append(str(interaction.guild.id))
db_channel_obj.append(msg)
if not str(interaction.channel.id) in local_verification:
msg = await client.get_channel(VERIFY_CHANNEL_ID).send(interaction.channel.id)
local_verification.append(str(interaction.channel.id))
db_channel_obj.append(msg)
if not str(verified_role.id) in local_verified_roles:
msg = await client.get_channel(VERIFIED_ROLES_CHANNEL_ID).send(verified_role.id)
local_verified_roles.append(str(verified_role.id))
local_verified_roles_obj.append(msg)
embed = discord.Embed(title=f"Select default permissions for \"{verified_role.name}\"", description=f"You can select your default permissions for \"{verified_role.name}\".", color=3566847)
await interaction.response.send_message(embed=embed, view=PermissionSelectVerified())
"""
guild = interaction.guild
embed = discord.Embed(title='Setup is now running. This can take a few minutes...\n(Discord API restriction)', description='This message will be automatically deleted when finished.', color=3566847)
try:
await interaction.response.send_message(embed=embed)
except:
await interaction.response.send_message("Setup is now running. This can take a few minutes...\n(Discord API restriction)\nThis message will be automatically deleted when finished.")
wait_msg = await interaction.original_message()
await interaction.channel.trigger_typing()
roles = []
for i in guild.roles:
roles.append(i.name)
if not str(guild.id) in local_verification:
msg = await client.get_channel(713392523502157946).send(guild.id)
local_verification.append(str(guild.id))
db_channel_obj.append(msg)
if not str(interaction.channel.id) in local_verification:
msg = await client.get_channel(713392523502157946).send(interaction.channel.id)
local_verification.append(str(interaction.channel.id))
db_channel_obj.append(msg)
role2 = verified_role
print(role2)
role3 = discord.utils.get(interaction.guild.roles, name='@everyone')
role4 = discord.utils.get(interaction.guild.roles, name='Verification')
add_lock.append(guild.id)
clocked = False
try:
failed_channels = []
for i in guild.channels:
changed_roles = []
for role in i.changed_roles:
changed_roles.append(role.name)
if not i in exclude:
if not "Verified" in changed_roles:
try:
await asyncio.sleep(3)
await interaction.channel.trigger_typing()
await i.set_permissions(role2, overwrite=discord.PermissionOverwrite(read_messages = True, send_messages=True))
await i.set_permissions(role4, overwrite=discord.PermissionOverwrite(read_messages = True, send_messages=True))
except Exception as e:
pass
await asyncio.sleep(2)
await interaction.channel.set_permissions(role2, overwrite=discord.PermissionOverwrite(read_messages = False, send_messages=False))
await interaction.channel.set_permissions(role4, overwrite=discord.PermissionOverwrite(read_messages = True, send_messages=True))
except:
pass
embed = discord.Embed(title='Verify-Channel set to the current channel!', color=3566847)
try:
await wait_msg.edit(embed=embed)
except:
await wait_msg.edit("Verify-Channel set to the current channel!\nThis message will be automatically deleted in 5 seconds.")
await asyncio.sleep(5)
try:
await failmsg.delete()
except:
pass
try:
await wait_msg.delete()
except:
pass
await asyncio.sleep(300)
add_lock.remove(guild.id)
"""
else:
embed = discord.Embed(title="You don't have permission for this command!", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("You don't have permission for this command!\nThis message will be automatically deleted in 5 seconds.", ephemeral=True)
@client.slash_command(name="remove-channel", description="Removes verification-system from current channel", default_member_permissions=discord.Permissions(8), dm_permission=False)
async def removechannel(interaction):
global s_code
global banned_users
global local_banned_users_obj
global banned_server
global banned_server_obj
global local_verify_message
global db_channel_obj6
global ready
await client.wait_until_ready()
global db_channel_obj
global ssave
global sp
global add_lock
global local_verification
global local_verified_roles
global local_verified_roles_obj
global local_not_verified_roles
global local_not_verified_roles_obj
global savedata
if not ready:
embed = discord.Embed(title="The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", ephemeral=True)
return
if MAINTENANCE and not interaction.author.id in ADMINS:
embed = discord.Embed(title='This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_', color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_", ephemeral=True)
return
if True:
perm = []
for i in interaction.author.guild_permissions:
perm.append(str(i))
if str("('administrator', True)") in perm or interaction.author.id in sp:
if str(interaction.channel.id) in local_verification:
try:
for i in interaction.guild.channels:
if str(i.id) in local_verification:
vchannel = str(i.id)
except:
pass
nachricht = discord.utils.get(db_channel_obj, content=vchannel)
try:
await nachricht.delete()
local_verification.remove(vchannel)
embed = discord.Embed(title='This verify-channel got deleted!', color=3566847)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This verify-channel got deleted!", ephemeral=True)
except:
embed = discord.Embed(title="This channel isn't a verify-channel!", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This channel isn't a verify-channel!", ephemeral=True)
else:
embed = discord.Embed(title="This channel isn't a verify-channel!", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This channel isn't a verify-channel!", ephemeral=True)
else:
embed = discord.Embed(title="You don't have permission for this command!", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("You don't have permission for this command!", ephemeral=True)
@client.slash_command(name="unverify", description="Unverify a user", options=[discord.Option("user", "User to unverify", discord.OptionType.user, required=True)], default_member_permissions=discord.Permissions(8), dm_permission=False)
async def unverify(interaction, user):
global s_code
global banned_users
global local_banned_users_obj
global banned_server
global banned_server_obj
global local_verify_message
global db_channel_obj6
global ready
await client.wait_until_ready()
global db_channel_obj
global ssave
global sp
global add_lock
global local_verification
global local_verified_roles
global local_verified_roles_obj
global local_not_verified_roles
global local_not_verified_roles_obj
global savedata
if not ready:
embed = discord.Embed(title="The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", ephemeral=True)
return
if MAINTENANCE and not interaction.author.id in ADMINS:
embed = discord.Embed(title='This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_', color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_", ephemeral=True)
return
if True:
perm = []
for i in interaction.author.guild_permissions:
perm.append(str(i))
if str("('administrator', True)") in perm or interaction.author.id in sp:
for role in interaction.guild.roles:
if str(role.id) in local_verified_roles:
role1 = discord.utils.get(interaction.guild.roles, id=role.id)
break
else:
role1 = discord.utils.get(interaction.guild.roles, name='Verified')
try:
await user.remove_roles(role1)
embed = discord.Embed(title=f'{user} unverified successfully!', description='', color=3566847)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message(f"{user} unverified successfully!", ephemeral=True)
except:
embed = discord.Embed(title='This user can\'t get unverified!', description='', color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This user can\'t get unverified!", ephemeral=True)
else:
embed = discord.Embed(title="You don't have permission for this command!", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("You don't have permission for this command!", ephemeral=True)
@client.slash_command(name="check-verify-channel", description="Checks if the current channel is defined as verify-channel", default_member_permissions=discord.Permissions(8), dm_permission=False)
async def checkverifychannel(interaction):
global s_code
global banned_users
global local_banned_users_obj
global banned_server
global banned_server_obj
global local_verify_message
global db_channel_obj6
global ready
await client.wait_until_ready()
global db_channel_obj
global ssave
global sp
global add_lock
global local_verification
global local_verified_roles
global local_verified_roles_obj
global local_not_verified_roles
global local_not_verified_roles_obj
global savedata
if not ready:
embed = discord.Embed(title="The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", ephemeral=True)
return
if MAINTENANCE and not interaction.author.id in ADMINS:
embed = discord.Embed(title='This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_', color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_", ephemeral=True)
return
if True:
perm = []
for i in interaction.author.guild_permissions:
perm.append(str(i))
if str("('administrator', True)") in perm or interaction.author.id in sp:
if str(interaction.channel.id) in local_verification:
embed = discord.Embed(title='This is a verify-channel!', color=3566847)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This is a verify-channel!", ephemeral=True)
else:
embed = discord.Embed(title="This channel isn't a verify-channel!", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This channel isn't a verify-channel!", ephemeral=True)
else:
embed = discord.Embed(title="You don't have permission for this command!", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("You don't have permission for this command!", ephemeral=True)
@client.slash_command(name="check-verification", description="Checks setup status of verification-system on your server", default_member_permissions=discord.Permissions(8), dm_permission=False)
async def checkverification(interaction):
global s_code
global banned_users
global local_banned_users_obj
global banned_server
global banned_server_obj
global local_verify_message
global db_channel_obj6
global ready
await client.wait_until_ready()
global db_channel_obj
global ssave
global sp
global add_lock
global local_verification
global local_verified_roles
global local_verified_roles_obj
global local_not_verified_roles
global local_not_verified_roles_obj
global savedata
if not ready:
embed = discord.Embed(title="The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", ephemeral=True)
return
if MAINTENANCE and not interaction.author.id in ADMINS:
embed = discord.Embed(title='This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_', color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_", ephemeral=True)
return
if True:
perm = []
botperm = []
for i in interaction.author.guild_permissions:
perm.append(str(i))
for i in interaction.channel.guild.me.guild_permissions:
botperm.append(str(i))
if str("('administrator', True)") in perm or interaction.author.id in sp:
await interaction.response.defer(ephemeral=True)
original_message = await interaction.original_message()
try:
for i in interaction.guild.channels:
if str(i.id) in local_verification:
vchannel = int(i.id)
vchannel = client.get_channel(int(vchannel))
except:
pass
channelperm = []
try:
for i in vchannel.permissions_for(interaction.channel.guild.me):
channelperm.append(str(i))
except:
pass
if str("('manage_messages', True)") in botperm or str("('manage_messages', True)") in channelperm:
manage_confirm = True
manage_confirmx = True
else:
manage_confirm = False
manage_confirmx = ('**' + str(False)) + '**'
if str(interaction.guild.id) in local_verification:
guild_confirm = True
guild_confirmx = True
else:
guild_confirm = False
guild_confirmx = ('**' + str(False)) + '**'
roles = []
for i in interaction.guild.roles:
roles.append(i.name)
for i in interaction.guild.roles:
if str(i.id) in local_verified_roles:
verified_confirm = True
verified_confirmx = f"{i} ({i.id})"
try:
role2 = discord.utils.get(interaction.guild.roles, id=i.id)
except:
pass
break
elif 'Verified' in roles:
role2 = discord.utils.get(interaction.guild.roles, name='Verified')
verified_confirm = True
verified_confirmx = f"{role2.name} ({role2.mention})\n{role2.id}"
break
else:
verified_confirm = False
verified_confirmx = '**' + str(None) + '**'
role2 = None
channels = []
channel_confirm = ''
for i in interaction.guild.channels:
if str(i.id) in local_verification:
channel_confirm = str(i.id)
channel_confirmx = f"{i.name} ({i.mention})\n{i.id}"
if channel_confirm == '':
channel_confirm = None
channel_confirmx = ('**' + str(None)) + '**'
try:
await interaction.channel.guild.me.add_roles(role2)
await asyncio.sleep(2)
await interaction.channel.guild.me.remove_roles(role2)
verified_high = True
verified_highx = True
except:
verified_high = False
verified_highx = ('**' + str(False)) + '**'
code22x = []
for messagex in db_channel_obj6:
code22x.append(messagex.content)
try:
ver_message = code22x.index(str(interaction.guild.id))
ver_message = code22x[ver_message-1]
except:
ver_message = "Default"
if guild_confirm == True and verified_confirm == True and not channel_confirm == None and verified_high == True and manage_confirm == True:
check_status = '**Everything is fine!**'
check_color = 3566847
else:
check_status = '**There are some errors! They are marked bold.**'
check_color = 16711680
embed = discord.Embed(title='Verification-Check', description=check_status, color=check_color)
embed.add_field(name='Server registered?', value=guild_confirmx, inline=False)
embed.add_field(name='Verify-Channel?', value=channel_confirmx, inline=False)
embed.add_field(name='Verified-role?', value=verified_confirmx, inline=False)
embed.add_field(name='Verified-role assignable?', value=verified_highx, inline=False)
embed.add_field(name='Delete messages in verify-channel?', value=manage_confirmx, inline=False)
embed.add_field(name='Verify-message?', value=ver_message, inline=False)
if guild_confirm == True and verified_confirm == True and not channel_confirm == None and verified_high == True and manage_confirm == True:
try:
embed.set_thumbnail(url='https://i.ibb.co/4sGPHCN/ixVTxxT.png')
except:
pass
else:
try:
embed.set_thumbnail(url='https://i.ibb.co/8dQWnzY/cq2w57Y.png')
except:
pass
try:
await original_message.edit(embed=embed)
except:
await original_message.edit(f"Verification-Check - {check_status}\nServer registered? - {guild_confirmx}\nVerify-Channel? - {channel_confirmx}\nVerified-role exist? - {verified_confirmx}\nVerified-role assignable? - {verified_highx}\nNot verified-role exist? - {not_verified_confirmx}\nNot verified-role assignable? - {not_verified_highx}\nDelete messages in verify-channel? - {manage_confirmx}")
else:
embed = discord.Embed(title="You don't have permission for this command!", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("You don't have permission for this command!", ephemeral=True)
@client.slash_command(name="verify-message", description="Set the verify-message, a new user see after running /verify", options=[discord.Option("message", "The verify-message", discord.OptionType.string)], default_member_permissions=discord.Permissions(8), dm_permission=False)
async def verifymessage(interaction, message=None):
global s_code
global banned_users
global local_banned_users_obj
global banned_server
global banned_server_obj
global local_verify_message
global db_channel_obj6
global ready
await client.wait_until_ready()
global db_channel_obj
global ssave
global sp
global add_lock
global local_verification
global local_verified_roles
global local_verified_roles_obj
global local_not_verified_roles
global local_not_verified_roles_obj
global savedata
if not ready:
embed = discord.Embed(title="The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("The bot is still starting up. Please wait a few minutes and try again! *(Tip: As soon as my Starting... status is gone, you can try again)*", ephemeral=True)
return
if MAINTENANCE and not interaction.author.id in ADMINS:
embed = discord.Embed(title='This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_', color=16711680)
try:
await interaction.response.send_message(embed=embed, ephemeral=True)
except:
await interaction.response.send_message("This command is currently blocked due to MAINTENANCE work! Please try again later. _(Tip: As soon as my MAINTENANCE status is gone, you can try again)_", ephemeral=True)
return
if True:
perm = []
for i in interaction.author.guild_permissions:
perm.append(str(i))
if str("('administrator', True)") in perm or interaction.author.id in sp:
if message is None:
if str(interaction.guild.id) in local_verify_message:
nachricht = discord.utils.get(db_channel_obj6, content=str(interaction.guild.id))
try:
await nachricht.delete()
try:
local_verify_message.remove(nachricht.content)