Skip to content
Permalink
5c09b1cfa3
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
48 lines (36 sloc) 1.36 KB
import asyncio
import discord
from discord.ext import commands
import sys, traceback
from botClient import client
from botClient import botToken
import guessFile
extensions = ['test', 'basicFunctionsFile', 'helpFile', 'guessFile'] #Extensions list
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print('CID: ' + str(client.user.id))
print('-----------------------')
if __name__ == '__main__': #Load extensions from other modules
for extension in extensions:
try:
client.load_extension(extension)
except Exception as error:
print(f'{extension} cannot be loaded [{error}]')
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content == 'hai':
await message.channel.send('YES')
await client.process_commands(message) #So that events don't disable commands
@client.event
async def on_member_join(member):
# print(ctx.author.guild.name) testing
await message.channel.send(f'Welcome {member.mention} to {member.guild.name}!')
await client.process_commands(message) #So that events don't disable commands
@client.command()
async def ctest(ctx):
await ctx.send('I heard you! {}'.format(ctx.author.mention))
client.run(botToken)