My bot is in multiple servers, and I want to make it only listen to a command if it's in certain server. Here's my code:
@client.command()
async def test(ctx):
server = ctx.message.guild
our_server = ('806969018689781870')
if server.id == our_server:
await ctx.send("Test confirmed!")
Here I get the ID of the server in which the command was triggered. Then I see if it equals the ID of the server I want to restrict it to. If it does, the command will be fulfilled.
However, this doesn't seem to work. It does not fulfill the command, and I don't get any errors. I'm new to programming, so any insight would be greatly appreciated.