How to get a channel inside on_message without bot | Discord.py
Hello! It is me again. File
currency.py from line 87 to 99. I have a function that adds credits to someone when they send a message and I have a spam-channel, so I don't want people to farm credits in spam-channel.
channel = discord.utils.get(message.guild.channels, id = 819705815090200646)
if channel.id != 819705815090200646:
But the bot doesn't any add any credits this way in ANY channel. And if I type
else: then bot adds credits in every channel, so the bot thinks that every channel has the same id. I need one specific channel where you don't get the credits, but you do in others.
Thank you! Sorry for bothering you!
P.S. Coder100 thank you already!
I believe you should compare it with the string version, like this:
if channel.id != '819705815090200646': await self.add_credits(message.author) print("yes2")
i do believe that channel.id is a string and of course a number will never equal a string
hello! sorry for answering too late, but no. This is not the case. When I print
channel.id it gives me the same id channel has, but I need that credits function doesn't work in this channel, but it somehow works. I also tried string, but I get the same result. The bot checks channel, but he ignores
!=. Is there any other way of doing this? Thanks @Coder100