-
Notifications
You must be signed in to change notification settings - Fork 2
/
Discord-Bot.py
2461 lines (1846 loc) · 81.8 KB
/
Discord-Bot.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 discord
import random
import asyncio
import json
import re
import aiofiles
import secrets
import async_timeout
import threading
import warnings
import logging
import sys
import time
import math
import keyword
import calendar
import venv
import webbrowser
import typing
import traceback
import youtube_dl
import os
import praw
import interactions
from googletrans import Translator
from discord.embeds import Embed
from datetime import datetime
from discord.ext.commands import BadArgument
from discord.ext.commands.cooldowns import BucketType
from discord.ext.commands import has_permissions, MissingPermissions
from github import Github
from aiohttp import ServerDisconnectedError
from aiohttp import ServerTimeoutError
from discord.voice_client import VoiceClient
from discord.ext import commands, tasks
from discord.utils import get
from discord import FFmpegPCMAudio
from discord import StageChannel
from discord import Webhook
from discord import Intents
from discord import Streaming
from youtube_dl import YoutubeDL
from subprocess import run
from dataclasses import dataclass
from os import name, system
from discord import Spotify
from discord import Status
from itertools import cycle
from datetime import date
from discord_slash import SlashCommand, SlashContext
from discord_slash.context import MenuContext
from discord_slash.model import ContextMenuType
from discord_slash.model import SlashCommandOptionType
from discord_slash.model import ChoiceData
from discord_slash.utils.manage_components import create_select, create_select_option, create_actionrow, create_button
from discord_slash.model import ButtonStyle
TOKEN = 'INSERT YOUR TOKEN HERE...' # <---- Your Bot Token goes here ! #
logger = logging.getLogger('discord')
logger.setLevel(logging.DEBUG)
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)
client = commands.Bot(command_prefix = '!', intents = discord.Intents.all())
client.launch_time = datetime.utcnow()
guild_ids = [0000000000000] # <------- Your Guild ID goes here (multiple guilds possible) #
client.warnings = {} # guild_id : {member_id: [count, [(admin_id, reason)]]}
slash = SlashCommand(client, sync_commands=True)
client.remove_command('help')
status = cycle(['Pokémon Scarlet', 'Pokémon Violet']) # Standard Games can be edited if needed #
ROLE = 'Member' # Standard Role can be edited if needed ! #
def setprefix():
with open("prefix.txt") as f: # (optional)
return "\n".join(f.readlines())
@client.event
async def on_ready():
for guild in client.guilds:
client.warnings[guild.id] = {}
async with aiofiles.open(f"{guild.id}.txt", mode="a") as temp:
pass
async with aiofiles.open(f"{guild.id}.txt", mode="r") as file:
lines = await file.readlines()
for line in lines:
data = line.split(" ")
member_id = int(data[0])
admin_id = int(data[1])
reason = " ".join(data[2:]).strip("\n")
try:
client.warnings[guild.id][member_id][0] += 1
client.warnings[guild.id][member_id][1].append((admin_id, reason))
except KeyError:
client.warnings[guild.id][member_id] = [1, [(admin_id, reason)]]
prefix = setprefix()
change_status.start()
print('Welcome back: ' + client.user.name + '\n')
print(f'This Program is designed for {OS10} {OS11} {MCOS} & {Linux_OS}')
print(f'Log_Update: {LogUP}')
print(f'Bot Version: {UV}')
print(f'Build Version: {Build_Ver_OS}')
# ====================== ITEM STORAGE VARIABLES ============================== #
RemovedFromBot = RemovedFromBot = 'This Command has been Removed!'
Added2Item = Added2Item = 'This Command has been recently added!'
NewItem = NewItem = 'This Command is new!'
RemovedInPatch = RemovedInPatch = 'This gets removed in the next Patch!'
Classic = Classic = 'This is a Legacy Command and it exists since the Bot was created'
NewItemCategory = NewItemCategory = 'This Section has been newly added to the Program'
# =============================================================================== #
Build_Ver_OS = Build_Ver_OS = '8.5.1'
Downtime = Downtime = 8
DownDate = DownDate = 'N/A'
Version = Version = 8.5
LogVer = LogVer = 3.5
Extension = Extension = 'Loaded'
ExtVer = ExtVer = 4.0
CMM = CMM = 'Online'
CSS = CSS = 12000
OS10 = OS10 = 'Windows 10'
OS11 = OS11 = 'Windows 11'
OS12 =OS12 = 'Windows 12'
MCOS = MCOS = 'Mac_OS'
Linux_OS = Linux_OS = 'Linux'
Server_Status = Server_Status = 'Online'
Server_Status2 = Server_Status2 = 'Offline'
Server_Status3 = Server_Status3 = 'Maintenance'
Server_Status4 = Server_Status4 = 'Closed'
Server_Status5 = Server_Status5 = 'Connection lost'
Support_End = Support_End = 'The Support Circle for the Program has ended'
TWWA = TWWA = 'Offline'
TWWB = TWWB = 'Live'
NSW2 = NSW2 = 'Nintendo Switch 2 Placeholder'
DL = DL = 'Deadlock'
CataCB = CataCB = 'Live'
CataC = CataC = 'Live'
CataCV = CataCV = 4.0
DFV = DFV = '10.2.7'
TWWV = TWWV = '11.0.2'
BOwner = BOwner = 'twitch.tv/shinyhunter2109'
LogUP = LogUP = 'Log succesfully updated'
newdat = newdat = 8.5
OWN = OWN = 10.5
data = ("🎉")
item = ("🎉")
Build = Build = 8.5
NewVer = NewVer = 8.5
NDate = NDate = '9/21/24'
Uploader = Uploader = 'Shinyhunter2109'
counter = data.count(item)
PR = PR = '8.5.0'
NPR = NPR = '8.5.2'
SDowntime = SDowntime = 'N/A'
PRDate = PRDate = 'N/A'
PRUploader = PRUploader = 'Shinyhunter2109'
DevBuild = DevBuild = 8.2
NDevB = NDevB = 8.5
PMP = PMP = 'TOP SECRET'
SoonTM = SoonTM = 'N/A'
DevUpload = DevUpload = '@Shinyhunter2109'
DevDate = DevDate = 'N/A'
BDSP = BDSP = 1.3
SV = SV = 3.0
# ======================== Pokemon Move Preset =============================== #
Name = Name = f'{SoonTM}'
Item = Item = f'{SoonTM}'
IVs = IVs = '31|31|31|31|31|31'
EVs = EVs = '252|252|8'
# ============================ Console Region Information ================================================= #
ConRegion1 = ConRegion1 = 'Europe'
ConRegion2 = ConRegion2 = 'US'
ConRegion3 = ConRegion3 = 'Japanese'
ConRegion4 = ConRegion4 = 'Asia'
# ======================== Pokemon Items / Pokeballs ========================== #
Ball1 = Ball1 = 'Poke Ball'
Ball2 = Ball2 = 'Great Ball'
Ball3 = Ball3 = 'Hyper Ball'
Ball4 = Ball4 = 'Timer Ball'
Ball5 = Ball5 = 'Dusk Ball'
Ball6 = Ball6 = 'Friend Ball'
Ball7 = Ball7 = 'Master Ball'
Ball8 = Ball8 = 'Heal Ball'
Ball9 = Ball9 = 'Repeat Ball'
Ball10 = Ball10 = 'Cherrish Ball'
# ============================== Abilities & Stuff ========================================================= #
Ability2 = Ability2 = 'Hidden'
Ability1 = Ability1 = 'Normal'
Ability = Ability = f'{Ability1}'
PokeBall = PokeBall = f'{Ball5}'
OrgTrain = OrgTrain = 'Shinyhunter'
Nature = Nature = f'{PMP}'
Moves = Moves = f'{PMP}'
Origin = Origin = f'{PMP}'
DSRegion = DSRegion = f'{PMP}'
ConsoleReg = ConsoleReg =f'{ConRegion1}'
# =================== Abomasnow Moveset ============================================= #
Abomasnow_EVS = Abomasnow_EVS = '92 HP / 252 SpA / 164 Spe'
AbomasnowAbil = AbomasnowAbil = 'Soundproof'
AbomasnowNat = AbomasnowNat = 'Mild'
AbomasnowMoves = AbomasnowMoves = 'Blizzard Giga Drain Focus Blast Ice Shard'
AbomasnowItem = AbomasnowItem = 'Abomasite'
AbomasnowLevel = AbomasnowLevel = '100'
# =============================================================== #
Abra_EVS = Abra_EVS = 'N/A'
AbraAbil = AbraAbil = 'N/A'
AbraNat = AbraNat = 'N/A' # TBD
AbraMoves = AbraMoves = 'N/A'
AbraItem = AbraItem = 'N/A'
# ====================== Bot Update Shedule ================================= #
spring = spring = 'N/A'
summer = summer = 'N/A'
fall = fall = '10/15/24'
winter = winter = '12/06/24'
# ================================ Seasons ================================== #
Season_1 = Season_1 = '09/21/24'
Season_2 = Season_2 = 'N/A'
Season_3 = Season_3 = 'N/A'
Season_4 = Season_4 = 'N/A'
Season_Reset = SeasonUpdate = 'The Old Season is Gone and the New Season has Started'
SeasonUpdate_Revoke = SeasonError = 'Error retrieving Seasonal Information !'
SeasonError = SeasonError = 'Something went wrong'
Season_Start = Season_Start = 1
SeasonClose = SeasonClose = 0
S_enable = S_enable = 'Season has started'
S_disable = S_disable = 'Season has ended'
Season_1 = Season_1 = S_enable
Season_2 = Season_2 = SeasonClose
# ============================ Network Information =================================================================== #
IsConsoleBanned = IsConsoleBanned = f'{SoonTM}'
Nintendo_Network_3ds = Nintendo_Network_3ds = 'Server Offline'
Nintendo_Switch_Network = Nintendo_Switch_Network = 'Server Online'
CFW_Server_Status = CFW_Server_Status = f'{PMP}'
Steam_Server_Status = Steam_Server_Status = 'Online'
Battle_Net_Status = Battle_Net_Status = 'Online'
EA_Status = EA_Status = 'Online'
EOS_Status = EOS_Status = 'Online'
# ======================================================== Server Status Switch ========================================#
BNS_1 = BNS_1 = 'ON'
BNS_2 = BNS_2 = 'OFF'
STS_1 = STS_1 = 'ON'
STS_2 = STS_2 = 'OFF'
EAS_1 = EAS_1 = 'ON'
EAS_2 = EAS_2 = 'OFF'
EOS_1 = EOS_1 = 'ON'
EOS_2 = EOS_2 = 'OFF'
# ======================== VALUES ========================================== # # Most of this will be used later #
NBV = NBV = 8.5
OBV = OBV = 8.5
ODV = ODV = 8.5
NDV = NDV = 8.5
NEV = NEV = 4.0
OEV = OEV = 3.9
OUE = OUE = 3.0
NUE = NUE = 3.2
OSV = OSV = 2.9
NSV = NSV = 3.5
OTV = OTV = 3.8
NTV = NTV = 4.0
EXT = EXT = 3.5
OEXT = OEXT = 3.0
UV = UV = NBV
RV = RV = OBV
# ============================================================================ #
class JoinDistance:
def __init__(self, joined, created):
self.joined = joined
self.created = created
@classmethod
async def convert(cls, ctx, argument):
member = await commands.MemberConverter().convert(ctx, argument)
return cls(member.joined_at, member.created_at)
@property
def delta(self):
return self.joined - self.created
@client.command()
async def delta(ctx, *, member: JoinDistance):
is_new = member.delta.days < 100
if is_new:
await ctx.send("You're pretty new!")
else:
await ctx.send("You're not so new.")
class MemberRoles(commands.MemberConverter):
async def convert(self, ctx, argument):
member = await super().convert(ctx, argument)
return [role.name for role in member.roles[1:]]
@client.command()
async def roles(ctx, *, member: MemberRoles):
"""Tells you a member's roles."""
await ctx.send('I see the following roles: ' + ', '.join(member))
@client.command()
async def joined(ctx, *, member: discord.Member):
await ctx.send('{0} joined on {0.joined_at}'.format(member))
class Slapper(commands.Converter):
async def convert(self, ctx, argument):
to_slap = random.choice(ctx.guild.members)
return '{0.author} slapped {1} because *{2}*'.format(ctx, to_slap, argument)
@client.command()
async def slap(ctx, *, reason: Slapper):
await ctx.send(reason)
@client.command()
async def serveri(ctx):
client.loop.create_task(server_icon())
await ctx.send("Loop started, replacing current icon.")
@client.command()
async def sync(ctx: commands.Context, guild: discord.Guild = None) -> None:
if guild is None:
await client.tree.sync()
else:
await client.tree.sync(guild=guild)
@client.command()
async def server_icon():
while True:
server1 = client.get_guild(00000000)
with open('EnterYourPathHere/jpg', 'rb') as f:
icon = f.read()
await server1.edit(icon=icon)
print("Server Icon changed.")
await asyncio.sleep(90)
@client.command()
@commands.has_permissions(manage_roles=True)
async def warn(ctx, member: discord.Member=None, *, reason=None):
if member is None:
return await ctx.send("**The provided member could not be found or you forgot to provide one.**")
if reason is None:
return await ctx.send("**Please provide a reason for warning this user.**")
try:
first_warning = False
client.warnings[ctx.guild.id][member.id][0] += 1
client.warnings[ctx.guild.id][member.id][1].append((ctx.author.id, reason))
except KeyError:
first_warning = True
client.warnings[ctx.guild.id][member.id] = [1, [(ctx.author.id, reason)]]
count = client.warnings[ctx.guild.id][member.id][0]
async with aiofiles.open(f"{ctx.guild.id}.txt", mode="a") as file:
await file.write(f"{member.id} {ctx.author.id} {reason}\n")
await ctx.send(f"{member.mention} has {count} {'warning' if first_warning else 'warnings'}.")
@client.command()
@commands.has_permissions(manage_roles=True)
async def warnings(ctx, member: discord.Member=None):
if member is None:
return await ctx.send("**The provided member could not be found or you forgot to provide one.**")
embed = discord.Embed(title=f"Displaying Warnings for {member.name}", description="", colour=discord.Colour.red())
try:
i = 1
for admin_id, reason in client.warnings[ctx.guild.id][member.id][1]:
admin = ctx.guild.get_member(admin_id)
embed.description += f"**Warning {i}** given by: {admin.mention} for: *'{reason}'*.\n"
i += 1
await ctx.send(embed=embed)
except KeyError: # no warnings
await ctx.send("**This user has no warnings.**")
@client.command()
@commands.cooldown(1, 190, commands.BucketType.user)
async def uptime(ctx):
delta_uptime = datetime.utcnow() - client.launch_time
hours, remainder = divmod(int(delta_uptime.total_seconds()), 3600)
minutes, seconds = divmod(remainder, 60)
days, hours = divmod(hours, 24)
await ctx.send(f'**Uptime for the program:** {days}d, {hours}h, {minutes}m, {seconds}s')
@uptime.error
async def uptime_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
msg = '**This command is ratelimited, please try again in {:.2f}s**'.format(error.retry_after)
await ctx.send(msg)
else:
raise error
@client.command()
async def BVersion(ctx):
if OBV < NBV:
await ctx.send(f'**Please download the latest Version from Github**')
else:
await ctx.send(f'**You are on the Latest Version**')
@client.command()
async def BugFix(ctx):
us = us = '@Shinyhunter2109'
await ctx.send(f'**Found a Bug?** | Contact **{us}** directly via DM ! | **Thank You**')
@client.command()
async def SeasonUpdate(ctx):
await ctx.send(f'New Season Patches will come on these Dates: **{spring}** | **{summer}** | **{fall}** | **{winter}**')
@client.command()
async def SeasonInfo(ctx):
await ctx.send(f'The First Season starts on: **{Season_1}**')
# ================================================= Economy Section Start ============================================================== #
@client.command()
async def balance(ctx):
await open_account(ctx.author)
user = ctx.author
users = await get_bank_data()
wallet_amt = users[str(user.id)]["wallet"]
bank_amt = users[str(user.id)]["bank"]
await ctx.send(f"**{ctx.author.name}'s coin balance**")
await ctx.send(f'**Coin balance:** {wallet_amt} coins')
await ctx.send(f'**Bank balance:** {bank_amt} coins')
@client.command()
@commands.cooldown(1, 86400, commands.BucketType.user)
async def dailybonus(ctx):
await open_account(ctx.author)
user = ctx.author
users = await get_bank_data()
earnings = random.randrange(1000)
await ctx.send(f'**Your Daily Bonus are:** {earnings} coins!!')
users[str(user.id)]["wallet"]+= earnings
with open("bank.json","w") as f:
json.dump(users,f)
@dailybonus.error
async def day_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
msg = '**You already claimed your Daily Reward | please try again in {:.2f}s**'.format(error.retry_after)
await ctx.send(msg)
else:
raise error
@client.command()
@commands.cooldown(1, 604800, commands.BucketType.user)
async def weeklybonus(ctx):
await open_account(ctx.author)
user = ctx.author
users = await get_bank_data()
earnings = random.randrange(2500)
await ctx.send(f'**Your Weekly Bonus are:** {earnings} coins!!')
users[str(user.id)]["wallet"]+= earnings
with open("bank.json","w") as f:
json.dump(users,f)
@weeklybonus.error
async def week_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
msg = '**You already claimed your Weekly Reward | please try again in {:.2f}s**'.format(error.retry_after)
await ctx.send(msg)
else:
raise error
@client.command()
@commands.cooldown(1, 2628000, commands.BucketType.user)
async def monthlybonus(ctx):
await open_account(ctx.author)
user = ctx.author
users = await get_bank_data()
earnings = random.randrange(5000)
await ctx.send(f'**Your Monthly Bonus are:** {earnings} coins!!')
users[str(user.id)]["wallet"]+= earnings
with open("bank.json","w") as f:
json.dump(users,f)
@monthlybonus.error
async def monthly_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
msg = '**You already claimed your Monthly Reward | please try again in {:.2f}s**'.format(error.retry_after)
await ctx.send(msg)
else:
raise error
async def open_account(user):
users = await get_bank_data()
if str(user.id) in users:
return False
else:
users[str(user.id)] = {}
users[str(user.id)]["wallet"] = 0
users[str(user.id)]["bank"] = 0
with open("bank.json","w") as f:
json.dump(users,f)
return True
async def get_bank_data():
with open("bank.json", "r") as f:
users = json.load(f)
return users
async def update_bank(user,change = 0,mode = "wallet"):
users = await get_bank_data()
users[str(user.id)][mode] += change
with open("bank.json","w") as f:
json.dump(users,f)
bal = [users[str(user.id)]["wallet"],users[str(user.id)]["bank"]]
return bal
@client.command()
@commands.cooldown(1, 31622400, commands.BucketType.user)
async def xmas_bonus(ctx):
await open_account(ctx.author)
user = ctx.author
users = await get_bank_data()
earnings = random.randrange(50000)
await ctx.send(f'**Your Christmas Bonus are:** {earnings} shinycoins!!')
await asyncio.sleep(5)
await ctx.send(f'**Bonus has been added to your Balance !**')
await asyncio.sleep(5)
await ctx.send(f'**This Bonus was secret and you found it before the event ended !**')
users[str(user.id)]["wallet"]+= earnings
with open("bank.json","w") as f:
json.dump(users,f)
@xmas_bonus.error
async def christmasevent_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
msg = '**The Christmas Event is over !| please try again in {:.2f}s**'.format(error.retry_after)
await ctx.send(msg)
else:
raise error
# Economy Section End #
@client.command(pass_context=True)
async def help(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.orange()
)
embed.set_author(name='help')
embed.add_field(name='.ping', value='Returns Pong!', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def coinhelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.gold()
)
embed.set_author(name='coinhelp')
embed.add_field(name='.coinflip', value='Return Heads/Tails', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def joinhelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.green()
)
embed.set_author(name='joinhelp')
embed.add_field(name='.join', value='Tells if joining from Bot was Successful', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def pokehelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.red()
)
embed.set_author(name='pokehelp')
embed.add_field(name='.pokemonname', value='Returns Info & Picture', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def bottlehelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.blue()
)
embed.set_author(name='bottlehelp')
embed.add_field(name='.bottles', value='Returns [Value of Beer]', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def spotifyhelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.green()
)
embed.set_author(name='spotifyhelp')
embed.add_field(name='.spotify', value='Returns listening Activity from the User', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def eightballhelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.light_grey()
)
embed.set_author(name='eightballhelp')
embed.add_field(name='.8ball', value='Returns one of the pre Messages for your Question', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def musichelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.dark_magenta()
)
embed.set_author(name='musichelp')
embed.add_field(name='.play', value='Returns the music that user has requested', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def kickhelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.orange()
)
embed.set_author(name='kickhelp')
embed.add_field(name='.kick', value='Kicks the User from the Discord-Server', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def banhelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.orange()
)
embed.set_author(name='banhelp')
embed.add_field(name='.ban', value='Bans the User from the Discord-Server', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def blackjackhelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.orange()
)
embed.set_author(name='blackjackhelp')
embed.add_field(name='.blackjack', value='Return either [You Won | You Lost | Tied]', inline=False)
await ctx.send(author, embed=embed)
@client.command(pass_context=True)
async def unbanhelp(ctx):
author = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.orange()
)
embed.set_author(name='unbanhelp')
embed.add_field(name='.unban', value='unbans a specific user that got banned recently', inline=False)
await ctx.send(author, embed=embed)
@client.command()
async def spotify(ctx):
await ctx.send(f'**Spotify is currently not available | Try again later !**')
@client.command()
async def CheckVersion(ctx):
if OBV < NBV:
await ctx.send(f'**Your Version Client is outdated ! | Please download the Latest Release from the Github Repo**')
embed = discord.Embed(
color= discord.Colour.dark_teal()
)
embed.add_field(name='Latest Release Build' ,value='[Click here to download]( https://github.com/Shinyhunter2109/Discord-Moveset-Bot/releases/download/8.0/Discord-Moveset-Bot.zip )', inline=False)
await ctx.send(embed=embed)
else:
await ctx.send(f'**You are on the Latest Version**')
@client.command()
async def ExtUpdate(ctx):
if OEXT < EXT:
await ctx.send(f'**You are using old Extensions | Please update to the latest Version {EXT}**')
else:
await ctx.send(f'**Up to Date**')
@client.command()
async def Log_Ver(ctx):
if OEXT < EXT:
await ctx.send(f'**Your Version Client is outdated ! | Please update to the latest Version**')
else:
await ctx.send(f'**Up to date**')
@client.command()
async def ToolVer(ctx):
if OTV < NTV:
await ctx.send(f'**Your Version Client is outdated ! | Please update to Version {NTV}**')
else:
await ctx.send(f'**Up to date**')
@client.command()
async def SecurityVer(ctx):
if OSV < NSV:
await ctx.send(f'**Your Version Client is outdated ! | Please update to Version {NSV}**')
else:
await ctx.send(f'**Up to date**')
@client.command()
async def OSVer(ctx):
OSVer = OSVer = 'Win 11'
OSNum = OSNum = '23H2'
OSBNum = OSBNum = '22631.3447'
await ctx.send(f'The Bot is currently running on **{OSVer}** with Build Number: **{OSNum}** and Build ID : **{OSBNum}**')
@client.command()
@commands.cooldown(1, 890, commands.BucketType.user)
async def ServerStatus(ctx):
await ctx.send(f'The Status of the Server is currently **{Server_Status3}**')
@Server_Status.error
async def server_stat_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
msg = '**This command is ratelimited, please try again in {:.2f}s**'.format(error.retry_after)
await ctx.send(msg)
else:
raise error
#@client.command(name="meme")
#async def meme(ctx, subred="memes"):
#msg = await ctx.send('Loading ... ')
#reddit = praw.Reddit(client_id='clientid',
#client_secret='clientsecret',
#username='username',
#password='password',
#user_agent='useragent')
#subreddit = await reddit.subreddit(subred)
#all_subs = []
#top = subreddit.top(limit=250) # bot will choose between the top 250 memes
#async for submission in top:
#all_subs.append(submission)
#random_sub = random.choice(all_subs)
#name = random_sub.title
#url = random_sub.url
#embed = Embed(title=f'__{name}__', colour=discord.Colour.random(), timestamp=ctx.message.created_at, url=url)
#embed.set_image(url=url)
#embed.set_author(name=ctx.message.author, icon_url=ctx.author.avatar_url)
#embed.set_footer(text='Here is your meme!')
#await ctx.send(embed=embed)
#await msg.edit(content=f'<https://reddit.com/r/{subreddit}/> :white_check_mark:')
#return
@client.command()
async def meme(ctx):
await ctx.send(f'**{RemovedFromBot}**')
@client.command()
@commands.cooldown(1, 18000, commands.BucketType.user)
async def report(ctx, member: discord.Member, *, arg):
role = ctx.guild.get_role(000000000000000) # enter role here #
members = ctx.guild.members
await ctx.channel.send('**Your complaint was sent to moderators!**', delete_after=10)
for i in role.members:
await i.send(f'{ctx.author.mention} sent a complaint on {member.mention} with reason:\n**{arg}**')
@report.error
async def rep_error(ctx, error):
if isinstance(error, commands.CommandOnCooldown):
msg = '**This command is ratelimited, please try again in {:.2f}s**'.format(error.retry_after)
await ctx.send(msg)
else:
raise error
@client.command()
async def pages(ctx):
contents = ["**This is page 1!**", "**This is page 2!**", "**This is page 3!**", "**This is page 4!**", "**This is Page 5!**", "**This is Page 6!**"]
pages = 6
cur_page = 1
message = await ctx.send(f"Page {cur_page}/{pages}:\n{contents[cur_page-1]}")
await message.add_reaction("◀️")
await message.add_reaction("▶️")
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) in ["◀️", "▶️"]
while True:
try:
reaction, user = await client.wait_for("reaction_add", timeout=60, check=check)
if str(reaction.emoji) == "▶️" and cur_page != pages:
cur_page += 1
await message.edit(content=f"Page {cur_page}/{pages}:\n{contents[cur_page-1]}")
await message.remove_reaction(reaction, user)
elif str(reaction.emoji) == "◀️" and cur_page > 1:
cur_page -= 1
await message.edit(content=f"Page {cur_page}/{pages}:\n{contents[cur_page-1]}")
await message.remove_reaction(reaction, user)
else:
await message.remove_reaction(reaction, user)
except asyncio.TimeoutError:
await message.delete()
break
@client.command(pass_context=True, aliases=['j', 'joi'])
async def join(ctx):
global voice
channel = ctx.message.author.voice.channel
voice = get(client.voice_clients, guild=ctx.guild)
if voice and voice.is_connected():
await voice.move_to(channel)
print(f'The bot has joined {channel}')
await ctx.send(f'Joined {channel}')
else:
print('Bot joined your Channel')
voice = await channel.connect()
@client.command(pass_context=True, aliases=['l', 'lea'])
async def leave(ctx):
global voice
channel = ctx.message.author.voice.channel
voice = get(client.voice_clients, guild=ctx.guild)
if voice and voice.is_connected():
await voice.disconnect()
print(f'The bot has left {channel}')
await ctx.send(f'Left {channel}')
@client.command(pass_context=True, aliases=['p', 'pla'])