discord.utils.get code example
Example 1: on message discord py
@bot.event
async def on_message(message):
if message.content == "pong":
await message.channel.send('ping')
Example 2: get guild from a channel discord py
channel.guild
Example 3: discord py server.channels
# Returns a list of all channels from all guilds( as channel IDs )
bot.get_all_channels()