Commands are imported from discord.ext. The PREF is '!'.
client = commands.Bot(command_prefix=PREF)
This event below is working.
@client.event
async def on_message(message):
wordd = 'say home'
if wordd in message.content:
await message.channel.send("home")
But this command below is not working...
@client.command()
async def welcome(ctx):
tablica = ["czesc", "siema", "witaj"]
await ctx.channel.send(random.choice(tablica))
Anyone help?
'
import discord
from discord.ext import commands
PREF = '!'
client = commands.Bot(command_prefix=PREF)
client.remove_command("help")
@client.event
async def on_message(message):
wordd = 'say home'
if wordd in message.content:
await message.channel.send("home")
@client.command()
async def welcome(ctx):
tablica = ["czesc", "siema", "witaj"]
await ctx.channel.send(random.choice(tablica))
client.run(<token>)