Sorry to bother everyone, I know this is duplicated but I don't have the rank to comment so I have to ask again, I've seen some other posts about this and all of them say you manually get the guild id and define it in on_ready() like:
@bot.event
async def on_ready():
guild = bot.get_guild(ID_OF_GUILD) # find ID by right clicking on server icon and choosing "copy id" at the bottom
if guild.get_member(ID_OF_MEMBER) is not None: # find ID by right clicking on a user and choosing "copy id" at the bottom
# the member is in the server, do something #
else:
# the member is not in the server, do something #
But how do I get the id of the guild automatically in on_message(), I would like my bot to run in various servers and as you can understand, that wouldn't really work.
If you need more context, its a bot where you have currencies and you can transfer them between users, I want to check if the user the message.author wants to transfer money to really exists.
Thanks in advance, Noel.