-
Notifications
You must be signed in to change notification settings - Fork 1
/
somebotnonsense.py
61 lines (44 loc) · 2.14 KB
/
somebotnonsense.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
import discord
import requests
import re
import json
client = discord.Client()
def load_env(filename):
if not filename:
return False
with open(filename, 'r') as f:
env = json.load(f.read())
return env
return False
@client.event
async def on_ready():
print("Assuming direct Control as {0.user}".format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.author.bot: return
# if discord.MessageType.default:
# await message.channel.send("HOW DARE YOU NOT USE C# TO COMPLETE THIS PROJECT!!!")
def transform(message):
return message.content
async for content in message.channel.history().map(transform):
if message.author.bot: return
if message.content.startswith('$meme'):
memes = {'key': 'values'}
response = requests.get("https://api.giphy.com/v1/gifs/search?api_key=p99LeIVnrws9GCWtbow9Oo4jNfJtBgac&q={}&limit=1&offset=&rating=R&lang=en".format(content), data = memes)
if response.status_code == 200:
print("success")
else: print('errors')
the_json = response.json()
await message.channel.send(the_json.get('data')[0].get('url'))
if message.content.startswith("Conanwhatisbestinlife"):
await message.channel.send("https://lh3.googleusercontent.com/-7GTRpb3sKm0/W-8_dEWgYuI/AAAAAAAAsv4/0ty3KkE3P4IRd9Aty7p6ap-8ye5HPsRAwCHMYCw/Conan%2BThe%2BBarbarian%252C%2BWhat%2Bis%2Bbest%2Bin%2Blife%2Bquote%2BQC%2Bwm_thumb%255B4%255D?imgmax=800")
await message.channel.send("To crush your enemies <br> some other stuff <br> meow")
await message.channel.send("See them driven before you")
await message.channel.send("And to hear the lamentation Of their women")
if discord.SystemChannelFlags.join_notifications:
await message.channel.send("DON'T TYPE THINGS")
if message.content.startswith("$PythonWelcome"):
await message.channel.send("Welcome to this server and enjoy our wonderful channels #general")
client.run('NzAzMzg5NTI1NjAyMzM2Nzgw.XqN7wQ.ZJNeL9u8xlLpnE-JS2tVa_ok_E0')