Created
February 18, 2020 20:10
-
-
Save Himan10/d661a65047fdfc36a2e4a73fa23866d5 to your computer and use it in GitHub Desktop.
Checking basic functionality of discord bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/home/hi-man/anaconda3/bin/python | |
| import os | |
| import discord | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| token = os.getenv('DISCORD_TOKEN') | |
| guild = os.getenv('CONSTRUCT_CODES') | |
| client = discord.Client() | |
| class MyClient(discord.Client): | |
| async def on_ready(): | |
| print(f'Logged in as : {client.user}') | |
| async def on_message(message): | |
| message.content = message.content.lower() | |
| if message.author == client.user: | |
| return | |
| if message.content.startswith('!hey'): | |
| await message.channel.send('Hello..') | |
| client.run(token) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment