how to make it so a discord bot messages in a certain channel python
channel = client.get_channel(12324234183172)
await channel.send('hello')
how to make it so a discord bot messages in a certain channel python
channel = client.get_channel(12324234183172)
await channel.send('hello')
how to make a discord bot send a message python
import discord
from discord.ext import commands
client = commands.Bot(command_prefix='!!') # This sets the prefix change if you want
TOKEN = 'insert token here' # tutorial at the bottom
@client.event
def on_ready():
print('Ready. Logged in as: {0.user}'.format(client)) # lets you know the bot is online and ready
# Now to see how to send a message to discord itself
@client.command(brief='Echoes back what user says.')
async def echo(ctx, *, user_message):
# The ctx is so that we can send the message on discord
# The astrix is so we can take multiple strings for the user message
# The string is the users message
await ctx.send('User said --> ' + user_message)
client.run(TOKEN)
# Now you can do any command you would like
# Using the ctx argument.
# HOW TO GET BOT TOKEN
# To get your bot's token simply go to:
# https://discord.com/developers/applications
# Login, and press new application (If you already have a bot skip this part)
# Press bot, and press yes you want to make it a bot
# Under token you will see copy, or regenerate
# Press copy and give the TOKEN variable the value of your token
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us