-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathself-bot.py
204 lines (159 loc) · 5.1 KB
/
self-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
import discord
from discord.ext import commands
from meme import GetMeme,SearchEmoji,generateUwU,bunny
import time
import random
from animals import Animals
import asyncio
#config
token = "ACCOUNT_TOKEN"
prefix = "~"
print ("starting")
bot = commands.Bot(command_prefix=prefix, self_bot=True)
@bot.event
async def on_ready():
print ("Ready to be MEME.")
# Prints when the bot is ready to be used.
try:
async def self_check(ctx):
if bot.user.id == ctx.message.author.id:
return True
else:
return False
# A secondary check to ensure nobody but the owner can run these commands.
#MEME
@commands.check(self_check)
@bot.command(pass_context=True)
async def emb(ctx,title,desc=None):
await ctx.message.delete()
embed = discord.Embed(
title = title,
description=desc,
colour = discord.Colour.blue())
await ctx.send(embed = embed)
@commands.check(self_check)
@bot.command(pass_context=True)
async def meme(ctx,*args):
await ctx.message.delete()
try:
link = GetMeme(*args)
embed = discord.Embed(
title = None,
colour = discord.Colour.blue())
embed.set_image(url = link)
await ctx.send(embed = embed)
except:
await ctx.send("```template not found :(```")
#random lmgtfy implementation cause why not
@commands.check(self_check)
@bot.command(pass_context=True)
async def search(ctx,*args):
await ctx.message.delete()
link = "https://lmgtfy.com/?q="
x = args
for i in range(len(x)):
if i == 0:
link = link + x[i]
else:
link = link + '+' + x[i]
await ctx.send(link)
@commands.check(self_check)
@bot.command(pass_context=True)
async def emoji(ctx,emoji):
await ctx.message.delete()
x = SearchEmoji(emoji)
await ctx.send(x)
@commands.check(self_check)
@bot.command(pass_context=True)
async def animal(ctx,name):
await ctx.message.delete()
animal = Animals(name)
await ctx.send(animal.image())
@commands.check(self_check)
@bot.command(pass_context=True)
async def spread(ctx,*args):
await ctx.message.delete()
x = args
text = ''
for i in x:
for j in i:
text = text + " " + j
await ctx.send(text)
@commands.check(self_check)
@bot.command(pass_context=True)
async def caps(ctx,*args):
await ctx.message.delete()
x = args
text = ''
final = ''
for i in x:
text = text+ " " +i
for i in text:
if random.randrange(0,2) == 0:
final = final + i.upper()
else:
final = final + i.lower()
await ctx.send(final)
#uwu command
@commands.check(self_check)
@bot.command(pass_context=True)
async def uwu(ctx,*args):
await ctx.message.delete()
x = args
text = ''
for i in x:
text = text+ " " +i
final = generateUwU(text)
await ctx.send(final)
#sign command
@commands.check(self_check)
@bot.command(pass_context=True)
async def sign(ctx,*args):
await ctx.message.delete()
x = args
text = ''
for i in x:
text = text+ " " +i
text = text[1:]
final = bunny(text)
fuck = "```" + final +"```"
await ctx.send(fuck)
#B command
@commands.check(self_check)
@bot.command(pass_context=True)
async def b(ctx,*args):
await ctx.message.delete()
x = args
text = ''
final = ''
for i in x:
text = text+ " " +i
for i in text:
if i == "b":
final = final+":b:"
else:
final = final + i
await ctx.send(final)
#ping command
@commands.check(self_check)
@bot.command(pass_context=True)
async def ping(ctx):
""" Pong! """
await ctx.message.delete()
before = time.monotonic()
message = await ctx.send("Pong!")
ping = (((time.monotonic() - before))/2) * 1000
await message.edit(content=f"Pong! :ping_pong: `{int(ping)}ms`")
@bot.command()
async def gay(ctx,text='so are any of you **NOT** gay?',time=5):
await ctx.message.delete()
message1 = await ctx.send(text)
await asyncio.sleep(time)
msg1 = await bot.wait_for('message')
# OR `check=lambda m: m.author == ctx.author`
await message1.edit(content="https://cdn.discordapp.com/attachments/691681269167161354/746351444810006679/eemxonrxj9151.png")
message2 = await ctx.send('https://cdn.discordapp.com/attachments/691681269167161354/746351506936168458/1ly9dyy0k9151.png')
except:
pass
bot.run(token, bot=False)
# Starts the bot by passing it a token and telling it it isn't really a bot.