-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMemer
829 lines (700 loc) · 39.2 KB
/
Memer
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
from discord.ext.commands import Bot
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
import asyncio
import platform
import colorsys
import random
import os
import time
from discord.voice_client import VoiceClient
from discord import Game, Embed, Color, Status, ChannelType
Forbidden= discord.Embed(title="Permission Denied", description="1) Please check whether you have permission to perform this action or not. \n2) Please check whether my role has permission to perform this action in this channel or not. \n3) Please check my role position.", color=0x00ff00)
client = Bot(description="DarkBot Bot is best", command_prefix="d!", pm_help = True)
client.remove_command('help')
async def status_task():
while True:
await client.change_presence(game=discord.Game(name='for d!help'))
await asyncio.sleep(5)
await client.change_presence(game=discord.Game(name='with '+str(len(set(client.get_all_members())))+' users'))
await asyncio.sleep(5)
await client.change_presence(game=discord.Game(name='in '+str(len(client.servers))+' servers'))
await asyncio.sleep(5)
@client.event
async def on_ready():
print('Logged in as '+client.user.name+' (ID:'+client.user.id+') | Connected to '+str(len(client.servers))+' servers | Connected to '+str(len(set(client.get_all_members())))+' users')
print('--------')
print('--------')
print('Started Dark BOT')
print('Created by Utkarsh')
client.loop.create_task(status_task())
def is_owner(ctx):
return ctx.message.author.id == "420525168381657090, 395535610548322326"
def is_dark(ctx):
return ctx.message.author.id == "420525168381657090"
def is_shreyas(ctx):
return ctx.message.author.id == "376602841625919488"
def is_gameworld(ctx):
return ctx.message.author.id == "402075464694366211"
def is_ranger(ctx):
return ctx.message.author.id == "304911836460089345"
@client.command(pass_context = True)
@commands.check(is_owner)
async def restart():
await client.logout()
@client.event
async def on_message(message):
await client.process_commands(message)
@client.event
async def on_member_join(member):
print("In our server" + member.name + " just joined")
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(color = discord.Color((r << 16) + (g << 8) + b))
embed.set_author(name='Welcome message')
embed.add_field(name = '__Welcome to Our Server__',value ='**Hope you will be active here. Check Our server rules and never try to break any rules. ',inline = False)
embed.set_image(url = 'https://media.giphy.com/media/OkJat1YNdoD3W/giphy.gif')
await client.send_message(member,embed=embed)
print("Sent message to " + member.name)
channel = discord.utils.get(client.get_all_channels(), server__name='DarkBot Official Server', name='darkbot-servers-join-leave-log')
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(title=f'Welcome {member.name} to {member.server.name}', description='Do not forget to check <#474572305192845312> and never try to break any one of them', color = discord.Color((r << 16) + (g << 8) + b))
embed.add_field(name='__Thanks for joining__', value='**Hope you will be active here.**', inline=True)
embed.add_field(name='Your join position is', value=member.joined_at)
embed.set_image(url = 'https://media.giphy.com/media/OkJat1YNdoD3W/giphy.gif')
embed.set_thumbnail(url=member.avatar_url)
await client.send_message(channel, embed=embed)
@client.command(pass_context=True)
@commands.has_permissions(kick_members=True)
async def unbanall(ctx):
server=ctx.message.server
ban_list=await client.get_bans(server)
await client.say('Unbanning {} members'.format(len(ban_list)))
for member in ban_list:
await client.unban(server,member)
@client.command(pass_context = True)
@commands.has_permissions(kick_members=True)
@commands.cooldown(rate=5,per=86400,type=BucketType.user)
async def access(ctx, member: discord.Member):
role = discord.utils.get(member.server.roles, name='Access')
await client.add_roles(member, role)
embed=discord.Embed(title="User Got Access!", description="**{0}** got access from **{1}**!".format(member, ctx.message.author), color=0xff00f6)
await client.say(embed=embed)
await asyncio.sleep(45*60)
await client.remove_roles(member, role)
@client.command(pass_context=True)
@commands.has_permissions(kick_members=True)
async def getuser(ctx, role: discord.Role = None):
if role is None:
await client.say('There is no "STAFF" role on this server!')
return
empty = True
for member in ctx.message.server.members:
if role in member.roles:
await client.say("{0.name}: {0.id}".format(member))
empty = False
if empty:
await client.say("Nobody has the role {}".format(role.mention))
@client.command(pass_context = True)
async def play(ctx, *, url):
author = ctx.message.author
voice_channel = author.voice_channel
try:
vc = await client.join_voice_channel(voice_channel)
msg = await client.say("Loading...")
player = await vc.create_ytdl_player("ytsearch:" + url)
player.start()
await client.say("Succesfully Loaded ur song!")
await client.delete_message(msg)
except Exception as e:
print(e)
await client.say("Reconnecting")
for x in client.voice_clients:
if(x.server == ctx.message.server):
await x.disconnect()
nvc = await client.join_voice_channel(voice_channel)
msg = await client.say("Loading...")
player2 = await nvc.create_ytdl_player("ytsearch:" + url)
player2.start()
@client.command(pass_context = True)
@commands.check(is_dark)
async def dmall(ctx, *, msg: str):
for server_member in ctx.message.server.members:
await client.send_message(server_member, msg)
await client.delete_message(ctx.message)
@client.command(pass_context = True)
async def stop(ctx):
for x in client.voice_clients:
if(x.server == ctx.message.server):
return await x.disconnect()
return await client.say("I am not playing anyting???!")
@client.command(pass_context=True)
@commands.has_permissions(kick_members=True)
async def joinvoice(ctx):
author = ctx.message.author
channel = author.voice_channel
await client.join_voice_channel(channel)
@client.command(pass_context=True, aliases=['em', 'e'])
async def modmail(ctx, *, msg=None):
channel = discord.utils.get(client.get_all_channels(), name='📬mod-mails📬')
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
color = discord.Color((r << 16) + (g << 8) + b)
if not msg:
await client.say("Please specify a message to send")
else:
await client.send_message(channel, embed=discord.Embed(color=color, description=msg + '\n Message From-' + ctx.message.author.id))
await client.delete_message(ctx.message)
return
@client.command(pass_context = True)
@commands.has_permissions(kick_members=True)
async def userinfo(ctx, user: discord.Member):
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(title="{}'s info".format(user.name), description="Here's what I could find.", color = discord.Color((r << 16) + (g << 8) + b))
embed.add_field(name="Name", value=user.name, inline=True)
embed.add_field(name="ID", value=user.id, inline=True)
embed.add_field(name="Status", value=user.status, inline=True)
embed.add_field(name="Highest role", value=user.top_role)
embed.add_field(name="Joined", value=user.joined_at)
embed.set_thumbnail(url=user.avatar_url)
await client.say(embed=embed)
@client.command(pass_context = True)
@commands.check(is_dark)
async def iamdark(ctx):
author = ctx.message.author
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='Utkarsh Kumar')
await client.add_roles(ctx.message.author, role)
print('Added Dark role in ' + (ctx.message.author.name))
await client.send_message(author, embed=embed)
@client.command(pass_context = True)
@commands.check(is_shreyas)
async def iamshreyas(ctx):
author = ctx.message.author
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='ShreyasMF')
await client.add_roles(ctx.message.author, role)
print('Added SHREYAS role in ' + (ctx.message.author.name))
await client.send_message(author, embed=embed)
@client.command(pass_context = True)
@commands.check(is_ranger)
async def iamgameworld(ctx):
author = ctx.message.author
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='Gameworld')
await client.add_roles(ctx.message.author, role)
print('Added GAMEWORLD role in ' + (ctx.message.author.name))
await client.send_message(author, embed=embed)
@client.command(pass_context = True)
@commands.check(is_ranger)
async def iamnotranger(ctx):
author = ctx.message.author
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='Dark Ranger')
await client.remove_roles(ctx.message.author, role)
print('Removed DarkRanger role in ' + (ctx.message.author.name))
await client.send_message(author, embed=embed)
@client.command(pass_context=True)
async def registerme(ctx):
author = ctx.message.author
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(title="Successfully added", description="REGISTERED role", color = discord.Color((r << 16) + (g << 8) + b))
embed.set_image(url = 'https://preview.ibb.co/e3iyap/ezgif_3_7dcc4d6bec.gif')
embed.add_field(name="Enjoy! ", value="Thanks for registering in Mini Militia Tournament", inline=True)
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='W4w tourney')
await client.add_roles(ctx.message.author, role)
print('Added REGISTERED role in ' + (ctx.message.author.name))
await client.send_message(author, embed=embed)
@client.command(pass_context=True)
async def iamcoder(ctx):
author = ctx.message.author
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(title="Successfully added", description="Programmer role", color = discord.Color((r << 16) + (g << 8) + b))
embed.add_field(name="Enjoy! ", value="Happy Coding :-). Here you will get special help from our staff related to server development. ", inline=True)
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='Programmer')
await client.add_roles(ctx.message.author, role)
print('Added codies role in ' + (ctx.message.author.name))
await client.send_message(author, embed=embed)
@client.command(pass_context=True)
async def iamnotcoder(ctx):
author = ctx.message.author
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(title="Successfully removed", description="Programmer role", color = discord.Color((r << 16) + (g << 8) + b))
embed.add_field(name="Enjoy! ", value="Hope you will try our other features as well", inline=True)
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='Programmer')
await client.remove_roles(ctx.message.author, role)
print('Removed codies role from ' + (ctx.message.author.name))
await client.send_message(author, embed=embed)
@client.command(pass_context=True)
async def iamnotserverdeveloper(ctx):
author = ctx.message.author
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(title="Successfully removed", description="Server developer role", color = discord.Color((r << 16) + (g << 8) + b))
embed.add_field(name="Enjoy! ", value="Hope you will try our other features as well", inline=True)
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='Server Developer')
await client.remove_roles(ctx.message.author, role)
print('Removed server developer role from ' + (ctx.message.author.name))
await client.send_message(author, embed=embed)
@client.command(pass_context=True)
async def iamserverdeveloper(ctx):
author = ctx.message.author
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(title="Successfully added", description="Server Developer role", color = discord.Color((r << 16) + (g << 8) + b))
embed.add_field(name="Enjoy! ", value="Happy Server Development. Here you will get special support from our support team related to server development", inline=True)
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='Server Developer')
await client.add_roles(ctx.message.author, role)
print('Added codies role in ' + (ctx.message.author.name))
await client.send_message(author, embed=embed)
@client.command(pass_context = True)
@commands.has_permissions(manage_roles=True)
async def role(ctx, user: discord.Member, *, role: discord.Role = None):
if role is None:
return await client.say("You haven't specified a role! ")
if role not in user.roles:
await client.add_roles(user, role)
return await client.say("{} role has been added to {}.".format(role, user))
if role in user.roles:
await client.remove_roles(user, role)
return await client.say("{} role has been removed from {}.".format(role, user))
@client.command(pass_context = True)
@commands.has_permissions(kick_members=True)
async def warn(ctx, userName: discord.User, *, message:str):
await client.send_message(userName, "You have been warned for: **{}**".format(message))
await client.say(":warning: __**{0} Has Been Warned!**__ :warning: ** Reason:{1}** ".format(userName,message))
pass
@client.command(pass_context=True)
async def ownerinfo(ctx):
embed = discord.Embed(title="Information about owner", description="Bot Name- DarkBot", color=0x00ff00)
embed.set_footer(text="Copyright@UK Soft")
embed.set_author(name=" Bot Owner Name- DarkLegend#3807,|Sunny Singh|™✓#4856,Tag<!--Back-->#1488\nID:420525168381657090,395535610548322326,399274658027012098")
embed.add_field(name="Site- https://bit.ly/darkbotauth", value="Thanks for adding our bot", inline=True)
await client.say(embed=embed)
@client.command(pass_context = True)
@commands.has_permissions(administrator=True)
async def setup(ctx):
author = ctx.message.author
server = ctx.message.server
mod_perms = discord.Permissions(manage_messages=True, kick_members=True, manage_nicknames =True,mute_members=True)
admin_perms = discord.Permissions(ADMINISTRATOR=True)
await client.create_role(author.server, name="Owner", permissions=admin_perms)
await client.create_role(author.server, name="Admin", permissions=admin_perms)
await client.create_role(author.server, name="Senior Moderator", permissions=mod_perms)
await client.create_role(author.server, name="G.O.H")
await client.create_role(author.server, name="Moderator", permissions=mod_perms)
await client.create_role(author.server, name="Muted")
await client.create_role(author.server, name="Friend of Owner")
await client.create_role(author.server, name="Verified")
everyone_perms = discord.PermissionOverwrite(send_messages=False, read_messages=True)
everyone = discord.ChannelPermissions(target=server.default_role, overwrite=everyone_perms)
user_perms = discord.PermissionOverwrite(read_messages=True)
user = discord.ChannelPermissions(target=server.default_role, overwrite=user_perms)
private_perms = discord.PermissionOverwrite(read_messages=False)
private = discord.ChannelPermissions(target=server.default_role, overwrite=private_perms)
await client.create_channel(server, '🎉welcome🎉',everyone)
await client.create_channel(server, '🎯rules🎯',everyone)
await client.create_channel(server, '🎥featured-content🎥',everyone)
await client.create_channel(server, '📢announcements📢',everyone)
await client.create_channel(server, '📢vote_polls📢',everyone)
await client.create_channel(server, 'private_chat',private)
await client.create_channel(server, '🎮general_chat🎮',user)
await client.create_channel(server, '🎮general_media🎮',user)
await client.create_channel(server, '👍bots_zone👍',user)
await client.create_channel(server, '🎥youtube_links🎥',user)
await client.create_channel(server, '🎥giveaway_links🎥',user)
await client.create_channel(server, '🎥other_links🎥',user)
await client.create_channel(server, '🔥Music Zone🔥', type=discord.ChannelType.voice)
await client.create_channel(server, '🔥music_command🔥s',user)
await client.create_channel(server, '🔥Chill Zone🔥', type=discord.ChannelType.voice)
@client.command(pass_context = True)
@commands.has_permissions(manage_nicknames=True)
async def setnick(ctx, user: discord.Member, *, nickname):
await client.change_nickname(user, nickname)
await client.delete_message(ctx.message)
@client.command(pass_context=True)
async def poll(ctx, question, *options: str):
if len(options) <= 1:
await client.say('You need more than one option to make a poll!')
return
if len(options) > 10:
await client.say('You cannot make a poll for more than 10 things!')
return
if len(options) == 2 and options[0] == 'yes' and options[1] == 'no':
reactions = ['👍', '👎']
else:
reactions = ['1\u20e3', '2\u20e3', '3\u20e3', '4\u20e3', '5\u20e3', '6\u20e3', '7\u20e3', '8\u20e3', '9\u20e3', '\U0001f51f']
description = []
for x, option in enumerate(options):
description += '\n {} {}'.format(reactions[x], option)
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(title=question, description=''.join(description), color = discord.Color((r << 16) + (g << 8) + b))
react_message = await client.say(embed=embed)
for reaction in reactions[:len(options)]:
await client.add_reaction(react_message, reaction)
embed.set_footer(text='Poll ID: {}'.format(react_message.id))
await client.edit_message(react_message, embed=embed)
@client.command(pass_context = True)
async def googlefy(ctx, *, msg = None):
if msg.content == "@everyone":
return
if msg.content == "@here":
return
if not msg: await client.say("Please specify a string")
else:
await client.say('http://lmgtfy.com/?q=' + msg)
return
@client.command(pass_context = True)
async def help(ctx):
author = ctx.message.author
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(color = discord.Color((r << 16) + (g << 8) + b))
embed.set_author(name='Help')
embed.set_image(url = 'https://image.ibb.co/caM2BK/help.gif')
embed.add_field(name = '``Our Help Server Link`` ',value ='https://discord.gg/vMvv5rr',inline = False)
embed.add_field(name = 'd!modhelp ',value ='Explaines all the commands which are only usable by Those who has moderation permissions. Like- Manage Nicknames, Manage Messages, Kick/Ban Members,etc.',inline = False)
embed.add_field(name = 'd!generalhelp ',value ='Explaines all the commands which are usable by everyone.',inline = False)
await client.send_message(author,embed=embed)
await client.say('📨 Check DMs For Information')
@client.command(pass_context = True)
async def modhelp(ctx):
author = ctx.message.author
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(color = discord.Color((r << 16) + (g << 8) + b))
embed.set_author(name='Moderation Commands Help')
embed.set_image(url = 'https://image.ibb.co/caM2BK/help.gif')
embed.add_field(name = 'd!say(Admin permission required) ',value ='Use it like ``d!say <text>``',inline = False)
embed.add_field(name = 'd!embed(Admin permission required) ',value ='Use it like ``d!embed <text>``',inline = False)
embed.add_field(name = 'd!membercount(Kick members Permission Required) ',value ='Use it like ``d!membercount`` to get membercount',inline = False)
embed.add_field(name = 'd!removemod(Admin Permission Required)',value ='Use it like ``d!removemod @user`` to remove him from mod. Note-You need Moderator role in your server below darkbot to use it.',inline = False)
embed.add_field(name = 'd!makemod(Admin Permission Required)',value ='Use it like ``d!makemod @user`` to make him mod. Note-You need Moderator role in your server below darkbot to use it.',inline = False)
embed.add_field(name = 'd!setup(Admin Permission Required)',value ='Use it to add channels, voice channels and roles if your server is not developed currently and you have just 1-2 channels. Note- Use it only 1 time. If you will use same command again then it will do same thing again .i.e It will add true copy of previous channels + true copy of roles that made in previous command use. So be careful.',inline = False)
embed.add_field(name = 'd!friend(Admin Permission Required) ',value ='Use it like ``d!friend @user`` to give anyone Friend of Owner role',inline = False)
embed.add_field(name = 'd!role(Manage Roles Permission Required)',value ='Use it like ``d!role @user <rolename>``.',inline = False)
embed.add_field(name = 'd!setnick(Manage nickname permission required)',value ='Use it like ``d!setnick @user <New nickname>`` to change the nickname of tagged user.',inline = False)
embed.add_field(name = 'd!english(Kick members Permission Required)',value ='Use it like ``d!english @user`` when someone speaks languages other than English.',inline = False)
embed.add_field(name = 'd!serverinfo(Kick members Permission Required) ',value ='Use it like ``d!serverinfo`` to get server info',inline = False)
embed.add_field(name = 'd!userinfo(Kick members Permission Required) ',value ='Use it like ``d!userinfo @user`` to get some basic info of tagged user',inline = False)
embed.add_field(name = 'd!kick(Kick members Permission Required)',value ='Use it like ``d!kick @user`` to kick any user',inline = False)
embed.add_field(name = 'd!roles(Kick members Permission Required) ',value ='Use it to check roles present in server',inline = False)
embed.add_field(name = 'd!clear(Manage Messages Permission Required)',value ='Use it like ``d!clear <number>`` to clear any message',inline = False)
embed.add_field(name = 'd!mute(Mute members Permission Required)',value ='Use it like ``d!mute @user <time>`` to mute any user',inline = False)
embed.add_field(name = 'd!unmute(Mute members Permission Required) ',value ='Use it like ``d!unmute @user`` to unmute anyone',inline = False)
embed.add_field(name = 'd!ban(Ban members Permission Required) ',value ='Use it like ``d!ban @user`` to ban any user',inline = False)
embed.add_field(name = 'd!rules(Kick members Permission Required)',value ='Use it like ``d!rules @user <violation type>`` to warn user',inline = False)
embed.add_field(name = 'd!warn(Kick members Permission Required)',value ='Use it like ``d!warn @user <violation type>`` to warn any user',inline = False)
embed.add_field(name = 'd!norole(Kick members Permission Required) ',value ='Use it like ``d!norole @user`` to warn anyone if he/she asks for promotion',inline = False)
embed.add_field(name = 'd!getuser(Kick members Permission Required) ',value ='Use it like ``d!getuser @rolename`` to get list of all users having a particular role',inline = False)
await client.send_message(author,embed=embed)
await client.say('📨 Check DMs For Information')
@client.command(pass_context = True)
async def generalhelp(ctx):
author = ctx.message.author
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(color = discord.Color((r << 16) + (g << 8) + b))
embed.add_field(name = 'd!poll ',value ='Use it like ``d!poll "Question" "Option1" "Option2" ..... "Option9"``.',inline = False)
embed.add_field(name = 'd!guess ',value ='To play guess game use ``d!guess <number> and number should be between 1-10``',inline = False)
embed.add_field(name = 'd!github ',value ='Use it like- ``d!github uksoftworld/DarkBot``',inline = False)
embed.add_field(name = 'd!bottutorial ',value ='Use it like ``d!bottutorial <tutorial name by darklegend>``',inline = False)
embed.add_field(name = 'd!dyno ',value ='Use it like ``d!d!dyno <dyno command name>``',inline = False)
embed.add_field(name = 'd!donate ',value ='Use it to donate us and get a special post on Official DarkBot server.',inline = False)
embed.add_field(name = 'd!ownerinfo ',value ='To get basic information about owner.',inline = False)
embed.add_field(name = 'd!sourcecode ',value ='Use it to see darkbot sourcecode.',inline = False)
embed.add_field(name = 'd!upvote ',value ='Use it to Upvote our bot and help us to grow',inline = False)
embed.add_field(name = 'd!authlink ',value ='Use it to get authorizing link to authorize this bot to your server.',inline = False)
embed.add_field(name = 'd!happybirthday @user ',value ='To wish someone happy birthday',inline = False)
embed.add_field(name = 'd!technews ',value ='Use it to get tech news',inline = False)
embed.add_field(name = 'd!googlefy ',value ='Use it like ``d!googlefy <string>``.',inline = False)
embed.add_field(name = 'd!spacenews ',value ='Use it to get space news',inline = False)
embed.add_field(name = 'd!phynews ',value ='Use it to get physycs',inline = False)
embed.add_field(name = 'd!verify ',value ='Use it to get verified role. Note- It needs proper setup.',inline = False)
embed.add_field(name = 'd!flipcoin ',value ='Flipps coin',inline = False)
embed.add_field(name = 'd!rolldice ',value ='Rolls dice',inline = False)
embed.add_field(name = 'd!avatar @user ',value ='Shows avatar',inline = False)
await client.send_message(author,embed=embed)
await client.say('📨 Check DMs For Information')
@client.command(pass_context=True)
@commands.has_permissions(kick_members=True)
async def kick(ctx,user:discord.Member):
if user.server_permissions.kick_members:
await client.say('**He is mod/admin and i am unable to kick him/her**')
return
try:
await client.kick(user)
await client.say(user.name+' was kicked. Good bye '+user.name+'!')
await client.delete_message(ctx.message)
except discord.Forbidden:
await client.say('Permission denied.')
return
@client.command(pass_context = True)
@commands.has_permissions(manage_messages=True)
async def clear(ctx, number):
if ctx.message.author.server_permissions.manage_messages:
mgs = [] #Empty list to put all the messages in the log
number = int(number) #Converting the amount of messages to delete to an integer
async for x in client.logs_from(ctx.message.channel, limit = number+1):
mgs.append(x)
try:
await client.delete_messages(mgs)
await client.say(str(number)+' messages deleted')
except discord.Forbidden:
await client.say(embed=Forbidden)
return
except discord.HTTPException:
await client.say('clear failed.')
return
await client.delete_messages(mgs)
@client.command(pass_context=True)
@commands.has_permissions(ban_members=True)
async def ban(ctx,user:discord.Member):
if user.server_permissions.ban_members:
await client.say('**He is mod/admin and i am unable to ban him/her**')
return
try:
await client.ban(user)
await client.say(user.name+' was banned. Good bye '+user.name+'!')
except discord.Forbidden:
await client.say('Permission denied.')
return
except discord.HTTPException:
await client.say('ban failed.')
return
@client.command(pass_context=True)
@commands.has_permissions(ban_members=True)
async def unban(ctx):
ban_list = await client.get_bans(ctx.message.server)
# Show banned users
await client.say("Ban list:\n{}".format("\n".join([user.name for user in ban_list])))
# Unban last banned user
if not ban_list:
await client.say('Ban list is empty.')
return
try:
await client.unban(ctx.message.server, ban_list[-1])
await client.say('Unbanned user: `{}`'.format(ban_list[-1].name))
except discord.Forbidden:
await client.say('Permission denied.')
return
except discord.HTTPException:
await client.say('unban failed.')
return
@client.command(pass_context = True)
@commands.has_permissions(administrator=True)
async def say(ctx, *, msg = None):
await client.delete_message(ctx.message)
if not msg: await client.say("Please specify a message to send")
else: await client.say(msg)
return
@client.command(pass_context = True)
@commands.has_permissions(kick_members=True)
async def rules(ctx, *, msg = None):
await client.delete_message(ctx.message)
if '@here' in msg or '@everyone' in msg:
return
if not msg: await client.say("Please specify a user to warn")
else: await client.say(msg + ', Please Read Rules again and never break any one of them again otherwise i will mute/kick/ban you next time.')
return
@client.command(pass_context = True)
@commands.has_permissions(administrator=True)
async def bans(ctx):
'''Gets A List Of Users Who Are No Longer With us'''
x = await client.get_bans(ctx.message.server)
x = '\n'.join([y.name for y in x])
embed = discord.Embed(title = "List of The Banned Idiots", description = x, color = 0xFFFFF)
return await client.say(embed = embed)
@client.command(pass_context=True)
@commands.has_permissions(kick_members=True)
async def serverinfo(ctx):
'''Displays Info About The Server!'''
server = ctx.message.server
roles = [x.name for x in server.role_hierarchy]
role_length = len(roles)
if role_length > 50: #Just in case there are too many roles...
roles = roles[:50]
roles.append('>>>> Displaying[50/%s] Roles'%len(roles))
roles = ', '.join(roles);
channelz = len(server.channels);
time = str(server.created_at); time = time.split(' '); time= time[0];
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
join = discord.Embed(description= '%s '%(str(server)),title = 'Server Name', color = discord.Color((r << 16) + (g << 8) + b));
join.set_thumbnail(url = server.icon_url);
join.add_field(name = '__Owner__', value = str(server.owner) + '\n' + server.owner.id);
join.add_field(name = '__ID__', value = str(server.id))
join.add_field(name = '__Member Count__', value = str(server.member_count));
join.add_field(name = '__Text/Voice Channels__', value = str(channelz));
join.add_field(name = '__Roles (%s)__'%str(role_length), value = roles);
join.set_footer(text ='Created: %s'%time);
return await client.say(embed = join);
@client.command(pass_context = True)
@commands.has_permissions(kick_members=True)
async def norole(ctx, *, msg = None):
await client.delete_message(ctx.message)
if '@here' in msg or '@everyone' in msg:
return
if not msg: await client.say("Please specify a user to warn")
else: await client.say(msg + ', Please Do not ask for promotions check Rules again.')
return
@client.command(pass_context = True)
async def happybirthday(ctx, *, msg = None):
if '@here' in msg or '@everyone' in msg:
return
if not msg: await client.say("Please specify a user to wish")
await client.say('Happy birthday ' + msg + ' \nhttps://asset.holidaycardsapp.com/assets/card/b_day399-22d0564f899cecd0375ba593a891e1b9.png')
return
@client.command(pass_context = True)
@commands.has_permissions(kick_members=True)
async def english(ctx, *, msg = None):
await client.delete_message(ctx.message)
if '@here' in msg or '@everyone' in msg:
return
if not msg: await client.say("Please specify a user to warn")
else: await client.say(msg + ', Please do not use language other than **English.**')
return
@client.command(pass_context = True)
@commands.has_permissions(kick_members=True)
async def hindi(ctx, *, msg = None):
await client.delete_message(ctx.message)
if '@here' in msg or '@everyone' in msg:
return
if not msg: await client.say("Please specify a user to warn")
else: await client.say(msg + ' abe oo angrez ke bacche chup chap hindi me baat kar nahi to mai pagla jaunga')
return
@client.command(pass_context = True)
async def htmltutorial(ctx, *, msg = None):
await client.delete_message(ctx.message)
if '@here' in msg or '@everyone' in msg:
return
if not msg: await client.say("Please specify a user")
else: await client.say('Welcome' + msg + ', Please check http://uksoft.000webhostapp.com/Programming-Tutorials/index.html')
return
@client.command(pass_context = True)
async def github(ctx, *, msg = None):
if '@here' in msg or '@everyone' in msg:
return
if not msg: await client.say("Please specify respo. ``Format- https://github.com/uksoftworld/DarkBot``")
else: await client.say('https://github.com/' + msg)
return
@client.command(pass_context = True)
async def reactionroles(ctx, *, msg = None):
if '@here' in msg or '@everyone' in msg:
return
if not msg: await client.say("Check this video to setup YAGPDB BOT- https://www.youtube.com/watch?v=icAqiw6txRQ")
else: await client.say('Check this video to setup YAGPDB BOT- https://www.youtube.com/watch?v=icAqiw6txRQ ' + msg)
return
@client.command(pass_context = True)
async def bottutorial(ctx, *, msg = None):
if '@here' in msg or '@everyone' in msg:
return
if not msg: await client.say("Tutorial not found or maybe you have mistyped it")
else: await client.say('https://github.com/uksoftworld/discord.py-tutorial/blob/master/' + msg + '.py')
return
@client.command(pass_context = True)
async def dyno(ctx, *, msg = None):
if '@here' in msg or '@everyone' in msg:
return
if not msg: await client.say("Command name not found or maybe you have mistyped it")
else: await client.say('https://github.com/uksoftworld/dynoCC/blob/master/' + msg)
return
@client.command(pass_context=True)
async def unverify(ctx):
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='Unverified')
await client.add_roles(ctx.message.author, role)
@client.command(pass_context=True)
async def verify(ctx):
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='Verified')
await client.add_roles(ctx.message.author, role)
@client.command(pass_context=True)
@commands.has_permissions(administrator=True)
async def friend(ctx, user:discord.Member,):
await client.delete_message(ctx.message)
role = discord.utils.get(ctx.message.server.roles, name='Friend of Owner')
await client.add_roles(ctx.message.mentions[0], role)
@client.command(pass_context = True)
@commands.has_permissions(administrator=True)
async def makemod(ctx, user: discord.Member):
nickname = '♏' + user.name
await client.change_nickname(user, nickname=nickname)
role = discord.utils.get(ctx.message.server.roles, name='Moderator')
await client.add_roles(user, role)
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
embed = discord.Embed(color = discord.Color((r << 16) + (g << 8) + b))
embed.set_author(name='Congratulations Message')
embed.add_field(name = '__Congratulations__',value ='**Congratulations for mod.Hope you will be more active here. Thanks for your help and support.**',inline = False)
embed.set_image(url = 'https://preview.ibb.co/i1izTz/ezgif_5_e20b665628.gif')
await client.send_message(user,embed=embed)
await client.delete_message(ctx.message)
@client.command(pass_context = True)
@commands.has_permissions(administrator=True)
async def removemod(ctx, user: discord.Member):
nickname = user.name
await client.change_nickname(user, nickname=nickname)
role = discord.utils.get(ctx.message.server.roles, name='Moderator')
await client.remove_roles(user, role)
await client.delete_message(ctx.message)
@client.command(pass_context = True)
async def botwarncode(ctx):
await client.say('https://hastebin.com/ibogudoxot.py')
return
@client.command(pass_context=True)
async def guess(ctx, number):
try:
arg = random.randint(1, 10)
except ValueError:
await client.say("Invalid number")
else:
await client.say('The correct answer is ' + str(arg))
@client.command(pass_context=True)
@commands.has_permissions(kick_members=True)
async def roles(context):
"""Displays all of the roles with their ids"""
roles = context.message.server.roles
result = "The roles are "
for role in roles:
result += '``' + role.name + '``' + ": " + '``' + role.id + '``' + "\n "
await client.say(result)
@client.command(pass_context=True, aliases=['server'])
@commands.has_permissions(kick_members=True)
async def membercount(ctx, *args):
"""
Shows stats and information about current guild.
ATTENTION: Please only use this on your own guilds or with explicit
permissions of the guilds administrators!
"""
if ctx.message.channel.is_private:
await bot.delete_message(ctx.message)
return
g = ctx.message.server
gid = g.id
membs = str(len(g.members))
membs_on = str(len([m for m in g.members if not m.status == Status.offline]))
users = str(len([m for m in g.members if not m.bot]))
users_on = str(len([m for m in g.members if not m.bot and not m.status == Status.offline]))
bots = str(len([m for m in g.members if m.bot]))
bots_on = str(len([m for m in g.members if m.bot and not m.status == Status.offline]))
created = str(g.created_at)
em = Embed(title="Membercount")
em.description = "```\n" \
"Members: %s (%s)\n" \
" Users: %s (%s)\n" \
" Bots: %s (%s)\n" \
"Created: %s\n" \
"```" % (membs, membs_on, users, users_on, bots, bots_on, created)
await client.send_message(ctx.message.channel, embed=em)
await client.delete_message(ctx.message)
@client.command(pass_context=True)
@commands.has_permissions(administrator=True)
async def embed(ctx, *args):
"""
Sending embeded messages with color (and maby later title, footer and fields)
"""
argstr = " ".join(args)
r, g, b = tuple(int(x * 255) for x in colorsys.hsv_to_rgb(random.random(), 1, 1))
text = argstr
color = discord.Color((r << 16) + (g << 8) + b)
await client.send_message(ctx.message.channel, embed=Embed(color = color, description=text))
await client.delete_message(ctx.message)
client.run(os.getenv('NTM2Mzg1OTY2NDQxNjI3NjQ4.D36nvw.66l6eB4GeXYgtLYyqlBugbBMLaA
'))