modmail-dev / Modmail

A Discord bot that functions as a shared inbox between staff and members, similar to Reddit's Modmail.
https://docs.modmail.dev
GNU Affero General Public License v3.0
1.58k stars 4.59k forks source link

Error when member sends message to Bot #16

Closed PallavBS closed 7 years ago

PallavBS commented 7 years ago

Ignoring exception in on_message 2017-10-30T06:25:16.385698+00:00 app[worker.1]: Traceback (most recent call last): 2017-10-30T06:25:16.385702+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 223, in _run_event 2017-10-30T06:25:16.385703+00:00 app[worker.1]: yield from coro(*args, **kwargs) 2017-10-30T06:25:16.385737+00:00 app[worker.1]: File "bot.py", line 366, in on_message 2017-10-30T06:25:16.385738+00:00 app[worker.1]: await self.process_modmail(message) 2017-10-30T06:25:16.385757+00:00 app[worker.1]: File "bot.py", line 335, in process_modmail 2017-10-30T06:25:16.385759+00:00 app[worker.1]: channel = discord.utils.get(guild.text_channels, topic=topic) 2017-10-30T06:25:16.385797+00:00 app[worker.1]: AttributeError: 'NoneType' object has no attribute 'text_channels'

PallavBS commented 7 years ago

Fixed: Line 225 in bot.py Replace channel = discord.utils.get(guild.text.channels, topic=topic) with channel = discord.utils.get(guild.channels, topic=topic)