dsicord py get message by id code example
Example 1: discord py server.channels
# Returns a list of all channels from all guilds( as channel IDs )
bot.get_all_channels()
Example 2: discord py fetch channel by id
channel = discord.utils.get(ctx.guild.channels, name=given_name)
channel_id = channel.id