1
1
import discord
2
2
import os
3
- from discord .ext import commands ,tasks
3
+ from discord .ext import commands , tasks
4
4
from itertools import cycle
5
5
import random
6
6
7
7
TOKEN = 'token'
8
- client = commands .Bot (command_prefix = "/" )
9
- status = cycle (['Eight arms' ,'Meow meow' ])
8
+ client = commands .Bot (command_prefix = "/" )
9
+ status = cycle (['Eight arms' , 'Meow meow' ])
10
10
players = {}
11
11
12
+ cursewords = {
13
+ "cursewords" : ["fuck" ,
14
+ "fuck off" ,
15
+ "shit" , "pissoff" ,
16
+ "dickhead" ,
17
+ "asshole" ,
18
+ "son of a bitch" ,
19
+ "bitch" ,
20
+ "shut the fuck up" ]
21
+ }
22
+
23
+
12
24
@client .event
13
25
async def on_ready ():
14
26
await client .change_presence (status = discord .Status .dnd , activity = discord .Game ('Meow meow' ))
15
27
print ("Bot is online" )
16
28
29
+
17
30
@client .event
18
31
async def on_member_join (member ):
19
32
print (f'{ member } has joined the server.' )
20
33
34
+
21
35
@client .event
22
36
async def on_member_remove (member ):
23
37
print (f'{ member } has left the server.' )
24
38
39
+
25
40
@client .command ()
26
41
async def hey_cat (ctx ):
27
42
await ctx .send ("Meow I'm gonna smother you with my tentacles" )
28
43
44
+
29
45
@client .command ()
30
46
async def mc (ctx ):
31
47
await ctx .send ("Life is always hard and on survival until it's not" )
32
48
33
- @client .command (aliases = ['8arm' ,'check' ])
34
- async def _8arm (ctx ,* ,question ):
35
- responses = [ 'As I see it, yes.' ,
36
- 'Ask again later.'
37
- 'Better not tell you now.' ,
38
- 'Cannot predict now.' ,
39
- 'Concentrate and ask again.' ,
40
- 'Don’t count on it.' ,
41
- 'It is certain.' ,
42
- 'It is decidedly so.' ,
43
- 'Most likely.' ,
44
- 'My reply is no.' ,
45
- 'My sources say no.' ,
46
- 'Outlook not so good.' ,
47
- 'Outlook good.' ,
48
- 'Reply hazy, try again.' ,
49
- 'Signs point to yes.' ,
50
- 'Very doubtful.' ,
51
- 'Without a doubt.' ,
52
- 'Yes.' ,
53
- 'Yes – definitely.' ,
54
- 'You may rely on it.' ]
49
+
50
+ @client .command (aliases = ['8arm' , 'check' ])
51
+ async def _8arm (ctx , * , question ):
52
+ responses = ['As I see it, yes.' ,
53
+ 'Ask again later.'
54
+ 'Better not tell you now.' ,
55
+ 'Cannot predict now.' ,
56
+ 'Concentrate and ask again.' ,
57
+ 'Don’t count on it.' ,
58
+ 'It is certain.' ,
59
+ 'It is decidedly so.' ,
60
+ 'Most likely.' ,
61
+ 'My reply is no.' ,
62
+ 'My sources say no.' ,
63
+ 'Outlook not so good.' ,
64
+ 'Outlook good.' ,
65
+ 'Reply hazy, try again.' ,
66
+ 'Signs point to yes.' ,
67
+ 'Very doubtful.' ,
68
+ 'Without a doubt.' ,
69
+ 'Yes.' ,
70
+ 'Yes – definitely.' ,
71
+ 'You may rely on it.' ]
55
72
await ctx .send (f'Question:{ question } \n Answer: { random .choice (responses )} ' )
56
73
74
+
57
75
@client .event
58
- async def on_command_error (ctx ,error ):
76
+ async def on_command_error (ctx , error ):
59
77
if isinstance (error , commands .CommandNotFound ):
60
78
await ctx .send ('Unfound tentacles' )
61
79
80
+
62
81
@client .command ()
63
- @commands .has_permissions (manage_messages = True )
64
- async def clear (ctx , amount = 5 ):
82
+ @commands .has_permissions (manage_messages = True )
83
+ async def clear (ctx , amount = 5 ):
65
84
await ctx .channel .purge (limit = amount )
66
85
67
- async def clear_error (ctx ,error ):
86
+
87
+ async def clear_error (ctx , error ):
68
88
await ctx .send ('Please specify the amount of messages to clear with tentacles' )
69
89
90
+
70
91
@client .command ()
71
- async def load (ctx ,extension ):
92
+ async def load (ctx , extension ):
72
93
client .load_extension (f'cogs.{ extension } ' )
73
94
95
+
74
96
@client .command ()
75
- async def unload (ctx ,extension ):
97
+ async def unload (ctx , extension ):
76
98
client .unload_extension (f'cogs.{ extension } ' )
77
99
100
+
78
101
@client .command ()
79
- async def reload (ctx ,extension ):
102
+ async def reload (ctx , extension ):
80
103
client .unload_extension (f'cogs.{ extension } ' )
81
104
client .load_extension (f'cogs.{ extension } ' )
82
105
@@ -85,22 +108,50 @@ async def reload(ctx,extension):
85
108
if filename .endswith ('.py' ):
86
109
client .load_extension (f'cogs.{ filename [:- 3 ]} ' )
87
110
111
+
88
112
@tasks .loop (seconds = 30 )
89
113
async def change_status ():
90
114
await client .change_presence (activity = discord .Game (next (status )))
91
115
116
+
92
117
@client .command (pass_context = True )
93
118
async def leave (ctx ):
94
119
server = ctx .message .server
95
120
voice_client = client .voice_client_in (server )
96
121
await voice_client .disconnect ()
97
122
98
- @client .command (pass_context = True )
123
+
124
+ @client .command (pass_context = True )
99
125
async def octoplay (ctx , url ):
100
126
server = ctx .message .server
101
127
voice_client = client .voice_client_in (server )
102
128
player = await voice_client .create_ytdl (url )
103
129
players [server .id ] = player
104
130
player .start ()
105
131
132
+
133
+ @client .command ()
134
+ async def marco (ctx ):
135
+ await ctx .send ("polo" )
136
+
137
+
138
+ @client .command ()
139
+ async def logout (ctx ):
140
+ await ctx .send ("Going Offline" )
141
+ await client .logout ()
142
+
143
+
144
+ @client .command ()
145
+ async def ping (ctx ):
146
+ await ctx .send (f"pong { round (client .latency * 1000 )} ms " )
147
+
148
+
149
+ @client .event
150
+ async def on_message (message ):
151
+ if (message .content in cursewords ):
152
+
153
+ await message .channel .purge (limit = 1 )
154
+ await message .author .create_dm ()
155
+ await message .author .dm_channel .send (f"{ message .author .name } that's a strike buddy" )
156
+
106
157
client .run (TOKEN )
0 commit comments