How do I get the channel a message was sent in?

235baron

I have been trying and making and building some channel lockdown commands, but they all didn't work. So far, I only have a lockdown command which locks a specific, fixed channel (code down below). So could someone tell me how to make a lockdown command which locks the channel the command was sent in?

@bot.command(aliases=['sd'])
@commands.has_role('Admin')
async def shutdown(ctx):
    """Shuts down #bank"""
    intro = bot.get_channel(768788764008251436)
    await intro.set_permissions(ctx.guild.default_role, send_messages=False)
Lu M

You retrieve the channel a message was sent in by calling.

intro = ctx.channel

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I send a message to a specific channel in discord.js?

How do i get just the channel id of the channel the bot and the channel the message author is in

How do I get the body of SENT data with Guzzle PHP?

Web Services: How do I detect the endpoint that sent the message

How do I get a bot to mention a channel?

How to wait for message in DM if the user sent a command in a channel?

How can I get the contents of the last message sent on a discord server

How can I get my bot to send a message to another channel?

Get last message sent to channel

How do I get the ID of a user that sent the message?

(discord.py) How do I get my bot to read DM's that are sent to it and either print them or send them to a specific channel

How do I add a reaction to the message I just sent

How can I get a list of all the messages in a channel and then pick a random message from that list to send as a message?

How do I check if a message is sent by a bot or not in discord.py?

How do i delete the previous messages that my discord bot sent in a specific channel?

How do I reply to a message outside of the channel I typed in?

How do I get ActionMailer to log sent messages but NOT include the attachments?

Discord.js How do I get the bot to react to the message it just sent in discord by id?

How do I get the channel name the command was sent to

how i can get image & Message telegram channel with python

How do I add a reaction to a message in a specific channel

How do I get my bot in discord to add reactions to a message whenever someone posts a message to a certain channel?

How do I get an invalid message to print?

How do I send this message to another specific channel?

How do I get the last message sent in a channel? | discord.js v13

How do I send a message in a specific channel with pycord?

How do I get the last message sent by a specific user?

How do I edit a message from a different channel that my bot sent?

How do I get discord bot to send a message to channel after it disconnects?