discord channel link in message

Charlie

Using discord.py, I am making a bot to send users a direct message if a keyword of their choosing is mentioned.

Everything is working, except I just want to add the channel they were mentioned in to the message. Here is my code:

        print("SENDING MESSAGE")
        sender = '{0.author.name}'.format(message)
        channel = message.channel.name
        server = '{0.server}'.format(message)
        await client.send_message(member, server+": #"+channel+": "+sender+": "+msg)

This results in a correct message being composed, but the #channel part of the message is not a clickable link as it would be if i typed it into the chat window myself. Is there a different object I should be feeding into the message?

Maverun

In Discord: there is channel mention. Try that way, do message.channel.mention instead of message.channel.name it should able to link a channel in PM or everywhere.

Source: Discord Documentation

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Assign discord role when user reacts to message in certain channel

From Java

Cloning and Deleting a channel: Discord.py

From Java

message.channel.id Discord PY

From Dev

link spring integration channel to hornetq

From Dev

discord.js not sending to custom channel

From Dev

How to link to an entry in a channel in expressionengine?

From Dev

How to broadcast message using channel

From Dev

postReceive on channel 'outputChannel', message is null

From Dev

Discord.js Voice Channel with Slash Commands

From Dev

how can i make my discord.py bot send a message i choose to a channel i choose?

From Dev

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

From Dev

Forwarding message from group or channel

From Dev

discord.js voice channel member count

From Dev

How to create a Discord channel with parent?

From Dev

Get last message from text channel with discord.js

From Dev

Check if a user can send message in a specific channel discord.js

From Dev

Get the channel deletor discord py

From Dev

How do I use discord.py to send a greeting message in the System Messages Channel

From Dev

How to create voice channel link

From Dev

Lock a channel in discord but users are alowed to see the channel

From Dev

discord channel link in message

From Dev

Sending Message to Discord Channel without message from user

From Dev

Hubot Slack: How to send message includes channel link?

From Dev

Pop message from channel in Redis

From Dev

message.channel.send not working discord.js

From Dev

Discord.py bot.send_message() does not go to the channel it has been called at

From Dev

Discord bot create a "channel" variable

From Dev

Discord Bot shall delete "user pinned message to channel" message

From Dev

Make Discord Bot post image from the link from the message

Related Related

  1. 1

    Assign discord role when user reacts to message in certain channel

  2. 2

    Cloning and Deleting a channel: Discord.py

  3. 3

    message.channel.id Discord PY

  4. 4

    link spring integration channel to hornetq

  5. 5

    discord.js not sending to custom channel

  6. 6

    How to link to an entry in a channel in expressionengine?

  7. 7

    How to broadcast message using channel

  8. 8

    postReceive on channel 'outputChannel', message is null

  9. 9

    Discord.js Voice Channel with Slash Commands

  10. 10

    how can i make my discord.py bot send a message i choose to a channel i choose?

  11. 11

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

  12. 12

    Forwarding message from group or channel

  13. 13

    discord.js voice channel member count

  14. 14

    How to create a Discord channel with parent?

  15. 15

    Get last message from text channel with discord.js

  16. 16

    Check if a user can send message in a specific channel discord.js

  17. 17

    Get the channel deletor discord py

  18. 18

    How do I use discord.py to send a greeting message in the System Messages Channel

  19. 19

    How to create voice channel link

  20. 20

    Lock a channel in discord but users are alowed to see the channel

  21. 21

    discord channel link in message

  22. 22

    Sending Message to Discord Channel without message from user

  23. 23

    Hubot Slack: How to send message includes channel link?

  24. 24

    Pop message from channel in Redis

  25. 25

    message.channel.send not working discord.js

  26. 26

    Discord.py bot.send_message() does not go to the channel it has been called at

  27. 27

    Discord bot create a "channel" variable

  28. 28

    Discord Bot shall delete "user pinned message to channel" message

  29. 29

    Make Discord Bot post image from the link from the message

HotTag

Archive