Answer the question
In order to leave comments, you need to log in
How to check for ID presence?
Hello, I'm making a bot ticket. There is a function to automatically send a ticket menu to the specified channel, it is specified using a command and the channel ID is entered into the database.
Code below:
channel = guild.get_channel(collticku.find_one({'_id': guild.id})['channel_id'])
if not channel:
return
else:
Answer the question
In order to leave comments, you need to log in
row = collticku.find_one({'_id': guild.id})
if not row or not ('channel_id' in row):
return
channel = guild.get_channel(row.get('channel_id'))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question