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.6k forks source link

[BUG] Bot refusing to create channel #2783

Closed ElijahPepe closed 4 years ago

ElijahPepe commented 4 years ago

Describe the bug The bot attempts to create a channel when modmailed, but cannot.

Bot Info Bot version: 3.4.1 Host method: Heroku

To Reproduce Steps to reproduce the behavior:

  1. Type to the bot.
  2. The bot will give you the check.
  3. No channel is created.

Error Logs

Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.7/site-packages/discord/client.py", line 270, in _run_event
    await coro(*args, **kwargs)
  File "bot.py", line 868, in on_message
    await self.process_commands(message)
  File "bot.py", line 875, in process_commands
    return await self.process_dm_modmail(message)
  File "bot.py", line 744, in process_dm_modmail
    thread = await self.threads.create(message.author)
  File "/app/core/thread.py", line 988, in create
    if category is None and len(cat.channels) == 50:
AttributeError: 'NoneType' object has no attribute 'channels'
2020-04-16 03:23:27 core.thread[918] - WARNING: Found existing thread for 301194255731392513 but the channel is invalid.
2020-04-16 03:23:30 core.thread[977] - WARNING: Found an existing thread for ElijahPepe#4897, closing previous thread.
2020-04-16 03:23:30 __main__[1126] - ERROR: Ignoring exception in on_message.
2020-04-16 03:23:30 __main__[1127] - ERROR: Unexpected exception:
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.7/site-packages/discord/client.py", line 270, in _run_event
    await coro(*args, **kwargs)
  File "bot.py", line 868, in on_message
    await self.process_commands(message)
  File "bot.py", line 875, in process_commands
    return await self.process_dm_modmail(message)
  File "bot.py", line 744, in process_dm_modmail
    thread = await self.threads.create(message.author)
  File "/app/core/thread.py", line 988, in create
    if category is None and len(cat.channels) == 50:
AttributeError: 'NoneType' object has no attribute 'channels'

Additional context Happens in every server regardless of anything.

StephenDaDev commented 4 years ago

is your bot in multiple servers? Have you changed the GUILD_ID recently?

ElijahPepe commented 4 years ago
  1. I just created it.
  2. I didn't change the GUILD_ID.
StephenDaDev commented 4 years ago

@ElijahPepe Is this issue still happening with the latest update?

gabefraser commented 4 years ago

I am experiencing the same issue. I haven't changed the GUILD_ID and I am using the latest version of repository.

lorenzo132 commented 4 years ago

Hey, try running ?setup , if this does not work try ?config set main_category_id 3672362836872387 ( replace the numbers with the modmail-catagory id ) And if none of those work your modmail-catagory most likely run out of channel space. ( the max allowed channels in 1 catagory is 50 )

fourjr commented 4 years ago

No recent reports, closing