-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbot.py
77 lines (65 loc) · 2.9 KB
/
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
from model import *
import os
import discord
#from scoretable import scoreboard
#from dotenv import load_dotenv
#load_dotenv()
#TOKEN = os.getenv('DISCORD_TOKEN')
image_types = ["png", "jpeg", "gif", "jpg"]
TOKEN =""
GUILD="testing"
from discord.ext import commands
#bot = commands.Bot(command_prefix='$')
client = discord.Client()
@client.event
async def on_ready():
print(f'{client.user} has connected to Discord!')
for guild in client.guilds:
#print(f'{guild} has connected the bot')
#print(guild.members)
'''if guild.name == GUILD:
await guild.send(file=discord.File("danish.jpg"))
message2='Yo guys , i am up! check out >help to know meeee.'
await message.channel.send('{}'.format(message2))'''
print("Bonjour")
break
@client.event
async def on_message(message):
if message.author == client.user:
return
for attachment in message.attachments:
if any(attachment.filename.lower().endswith(image) for image in image_types):
await attachment.save("sample.gif")
#print("its running eveything below")
#print("ahhh filter running before")
filter_func("sample.gif")
#display toonify
await message.channel.send(file=discord.File("toonify.gif"))
await message.channel.send(file=discord.File("blackwhite.gif"))
#display toonify
if message.content.startswith('>developers info'):
#message2='Team members :Raghav,Abhijnya and Jaaswin D Kots , And that is us in that order xD'+str(message.author)[:-5]
#await message.channel.send('{}'.format(message2))
await message.channel.send(file=discord.File("spiderman.jpg"))
#await message.channel.send(file=discord.File("abj.jpg"))
#await message.channel.send(file=discord.File("jas.jpg"))
if message.content.startswith('>hi potter'):
message2='Hello There , Welcome to the Future'
await message.channel.send('{}'.format(message2))
'''elif message.content.startswith('3'):
message2='Jaaswin D kots'
await message.channel.send('{}'.format(message2))
if message.content.startswith('>hi Potter'):
message2='Hi there, '+str(message.author)[:-5]
await message.channel.send('{}'.format(message2))
if message.content.startswith('>rcb'):
message2='Nope they dont win ipl, '+str(message.author)[:-5]
await message.channel.send('{}'.format(message2))'''
if message.content.startswith('>help'):
message2='This bot is currently in development, '+str(message.author)[:-5]+'.The commands availabe are >hi potter ,developers info(upcoming) , >click a pic(upcoming) '
await message.channel.send('{}'.format(message2))
'''@bot.command()
async def test(ctx, arg):
ctx.send(arg)
'''
client.run(TOKEN)