Skip to content
Permalink
Browse files
Create discord.py
  • Loading branch information
varapnicks committed Nov 20, 2021
1 parent 5ff4103 commit 4541ac8757e390b296974b7fb854b8891af8d808
Showing 1 changed file with 43 additions and 0 deletions.
@@ -0,0 +1,43 @@
import discord

def read_token():
with open ("token.txt", "r") as file:
lines = file.readlines()
return lines[0].strip()

token = read_token()

client = discord.Client()
@client.event
async def on_message(message):

if message.author == client.user:
return
if message.content != 'hello':
await message.channel.send('Sorry I do not understand. Can you repeat please.')
else:
await message.add_reaction('\U0001F60E')

await message.channel.send("Hi, I am a Movie Chat bot. It is very nice to see you!")


@client.event
async def on_message_edit(before, after):
await before.channel.send(
f'{before.author} edit a message.\n'
f'Before: {before.content}\n'
f'After: {after.content}'
)



@client.event
async def on_ready():
print("Bot is online!")

client.run(token)





0 comments on commit 4541ac8

Please sign in to comment.