Coder Social home page Coder Social logo

modmail-dev / modmail Goto Github PK

View Code? Open in Web Editor NEW
1.6K 1.6K 4.6K 7.04 MB

A Discord bot that functions as a shared inbox between staff and members, similar to Reddit's Modmail.

Home Page: https://docs.modmail.dev

License: GNU Affero General Public License v3.0

Python 99.76% Dockerfile 0.23% Shell 0.01% Procfile 0.01%
bot discord discord-api discord-bot discord-modmail discord-py modmail python python3

modmail's People

Contributors

agent-fennec avatar aloqeely avatar andyondrya avatar coolguy3289 avatar fourjr avatar infinitepower18 avatar ingeniouscoder avatar isaacli430 avatar jerrie-aries avatar karatewumpus avatar kyb3r avatar lorenzo132 avatar martinbndr avatar officialpiyush avatar officialteen avatar popeeyy avatar qwerty-133 avatar realcyguy avatar redstonedesigner avatar robinmahieu avatar scragly avatar sebkuip avatar stephendadev avatar taaku18 avatar vinchethescript avatar vivekjoshy avatar webkide avatar weirdllamas avatar xaos1502 avatar zoemartin01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modmail's Issues

Status dissapears after few hours

Anytime i do [p]customstatus [status] it sets it for a few hours, but after like 5/6 hours it resets and you have to do it again.
Is this a common issue?

Modmail doesn't create new threads when DM'd

Seems like all invite links for the support discord server are down, so here's the issue:

I (think) I set up the bot properly using the "deploy to Heroku" method. I entered the server ID from the server I want to use the bot on. Entered the bots unique token and a custom prefix and deployed it.

The set up worked and it created the categories Mod Mail and Mod Mail archives while also the bot-info channel under mod mail.

However if someone DM's it it only leaves a checkmark reaction under the message instead of creating a new thread so I can't reply to it.

Where did I mess up? No clue how to get the Heroku logs or I would include them.

Doesn't work...

I set it up as you wrote and when i dm the bot it leaves a little check mark and thats it. It's pretty much useless.

Can't set it up

So my prefix is !! and when I say !!help it perfectly works, but when I say !!setup @help the bot won't respond at all. Please help me set it up

[ISSUE] Unblock Command

@kyb3r Unblock Command

The unblock command needs fixing as it doesn't work correctly, so I had to remove the ID from the channel list in the info of the bot so that it would fix, quite slow doing it manually.

If I were to feedback your coding I would rate it 10/10 so good job on your work and have a great day!

Thanks, Shad #

Allow tagged users in !block command

Currently !block can only take in user id. While this is great and all it also makes it hard to track which users are blocked. Allow @ tags to be passed through !block

Modmail bot won't work correctly

Hello, my Modmail bot doesn't seem to be working. When I send it a message, I won't get it in the mod mail channel. In the log history this shows up:

2018-03-18T23:08:23.263756+00:00 app[worker.1]: Ignoring exception in on_message
2018-03-18T23:08:23.263973+00:00 app[worker.1]: Traceback (most recent call last):
2018-03-18T23:08:23.264024+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 224, in _run_event
2018-03-18T23:08:23.264028+00:00 app[worker.1]: yield from coro(*args, **kwargs)
2018-03-18T23:08:23.264075+00:00 app[worker.1]: File "bot.py", line 379, in on_message
2018-03-18T23:08:23.264078+00:00 app[worker.1]: await self.process_modmail(message)
2018-03-18T23:08:23.264117+00:00 app[worker.1]: File "bot.py", line 353, in process_modmail
2018-03-18T23:08:23.264120+00:00 app[worker.1]: blocked = top_chan.topic.split('Blocked\n-------')[1].strip().split('\n')
2018-03-18T23:08:23.264178+00:00 app[worker.1]: AttributeError: 'NoneType' object has no attribute 'split'

Not sure what I did wrong, I gave the bot manage channel permissions.

Bot wont open new channel

the bot wont open a new channel when it is dm'ed. It has #bot-info but it just replies to dms with the checkmark reaction

disable ping command?

need to add an option to disable the ping command or make it so that certain people can do it?

.

EDIT: sorry for saying the bot was intended for malice, I've looked over the code and it isn't, I just assumed it was. However, it's my fault for leaking the token, be sure not to leak yours like I did mine or your server will be at risk!

Setup Command Doesn't Enable Bot

Hello,

I had an issue with the bot not setting up. I was able to resolve that. It said setup successful, but when messaging the bot, it only creates a reaction in a DM.

Not responding

When i do *customstatus DM me for support it will not work

suggestion.

add snippets/pre defined messages. like let us create our own commands that respond with a msg set by us

Does this bot self-ping to self-sustain on Heroku?

Heroku has like a 30 min or 1 hour sustain itself, which you can stop from doing by reloading the app's site thing that heroku gives you to see.

however, this repository doesnt have anything that can allow it to be seen in the web (it ends upi saying error) so how can i make this bot self-sustain or is it already within the bot?

Help

This is not really an issue but I need help. I downloaded python and I could not how to add Navigate to the bot folder. i.e cd desktop/modmail-master
Install all the requirements: pip install -r requirements.txt
Run the bot with python bot.py or on mac or linux python3.6 bot.py
Enter your token and server ID in the wizard.

Can you elaborate please and thank you ?

Status

Command to change the bot status

Limit by Role

Is there a way to limit who can start a modmail by role?

Person not Bot

What would happen if the person used their own token for the bot instead of the bots token?

Will not create channel

I have added the bot with the manage channel permissions and when it is dm'd by a user it will react but not create a new channel even after i have done %setup @mods.

Game Broke

customstatus and any game status broke after new discord update

Config Var [STATUS] Doesnt work

The config variable STATUS does not work for me, after updating and all.
I am able to set it through the command, but I was told that would not be permanent

AttributeError: 'NoneType' object has no attribute 'text_channels'

When a DM is sent to the bot, it emoji reacts with βœ…, but the message isn't being displayed as a channel in the server. The bot-info channel is available, though. The following error(s) keep occurring in Heroku when a message is sent to the bot.

2018-11-02T11:08:38.395920+00:00 app[worker.1]: Ignoring exception in on_message
2018-11-02T11:08:38.396107+00:00 app[worker.1]: Traceback (most recent call last):
2018-11-02T11:08:38.396163+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 225, in _run_event
2018-11-02T11:08:38.396167+00:00 app[worker.1]: await coro(*args, **kwargs)
2018-11-02T11:08:38.396173+00:00 app[worker.1]: File "bot.py", line 382, in on_message
2018-11-02T11:08:38.396175+00:00 app[worker.1]: await self.process_modmail(message)
2018-11-02T11:08:38.396179+00:00 app[worker.1]: File "bot.py", line 353, in process_modmail
2018-11-02T11:08:38.396182+00:00 app[worker.1]: channel = discord.utils.get(guild.text_channels, topic=topic)
2018-11-02T11:08:38.396239+00:00 app[worker.1]: AttributeError: 'NoneType' object has no attribute 'text_channels'

Bot does not create a new channel on new DM

Got this trace in logs @4rqm :
2018-07-05T11:46:48.754088+00:00 app[worker.1]: Ignoring exception in on_message
2018-07-05T11:46:48.754278+00:00 app[worker.1]: Traceback (most recent call last):
2018-07-05T11:46:48.754565+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 224, in _run_event
2018-07-05T11:46:48.754568+00:00 app[worker.1]: yield from coro(*args, **kwargs)
2018-07-05T11:46:48.754612+00:00 app[worker.1]: File "bot.py", line 379, in on_message
2018-07-05T11:46:48.754614+00:00 app[worker.1]: await self.process_modmail(message)
2018-07-05T11:46:48.754656+00:00 app[worker.1]: File "bot.py", line 353, in process_modmail
2018-07-05T11:46:48.754660+00:00 app[worker.1]: blocked = top_chan.topic.split('Blocked\n-------')[1].strip().split('\n')
2018-07-05T11:46:48.754717+00:00 app[worker.1]: AttributeError: 'NoneType' object has no attribute 'split'

Rant

This is a terrible modmail. I don't know how to check the mail, everything is hard to setup. The bot goes offline randomly, the game status always disappear, it doesn't even respond and it is too complicated to setup. Do not ever use this bot to mod mail, trust me. This is terrible and the owner never answers ticket because he did no shit to help and not a great developer. Don't get this, trust me. You will have a hard time and I know how to setup bots. But this crappy bot is terrible.

Game Status

Each time I set the game status, it successfully sets it but after a while, it disappears. I know no one has the permissions to do !!customstatus(that's my prefix), but I did check just in case and no one did the command nor able to change it. So, what is making it disappear, I removed the bot and invited it back and tested it and waited about an hour to see if it will keep doing that and it did. What is going on here?

Bot doesn't DM

I've done (my prefix) setup
The bot has the permissions to create channel but it doesn't DM me when someone DMS thr bot

Please help

If I click deploy to heroku it says No Apps.json in the Repo URL. I don’t know what to do

Translate

Hi,

Can I translate this bot without problems and still run it?

DM Does not arrive

I have set the thing up, its hosted and all. There is an extra catagory named "modmail" and when I dm the bot I also get the reaction.
My DM however does not add another channel/thread, so me as moderator couldnt see anything. Anyone know why?

Bot not answering or sending messages

The bot isn't telling or showing me that someone has sent a message to the bot.

My logs on Heroku:2018-06-01T20:38:02.162854+00:00 app[worker.1]: Ignoring exception in on_message
2018-06-01T20:38:02.168891+00:00 app[worker.1]: Traceback (most recent call last):
2018-06-01T20:38:02.168906+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 224, in _run_event
2018-06-01T20:38:02.168908+00:00 app[worker.1]: yield from coro(*args, **kwargs)
2018-06-01T20:38:02.169028+00:00 app[worker.1]: File "bot.py", line 379, in on_message
2018-06-01T20:38:02.169031+00:00 app[worker.1]: await self.process_modmail(message)
2018-06-01T20:38:02.169037+00:00 app[worker.1]: File "bot.py", line 350, in process_modmail
2018-06-01T20:38:02.169040+00:00 app[worker.1]: channel = discord.utils.get(guild.text_channels, topic=topic)
2018-06-01T20:38:02.169088+00:00 app[worker.1]: AttributeError: 'NoneType' object has no attribute 'text_channels'
2018-06-01T20:40:15.790393+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=modmailbotv2.herokuapp.com request_id=f2f31472-175e-43d8-9d17-ebd44a2ad70f fwd="86.31.203.216" dyno= connect= service= status=503 bytes= protocol=https

Setup command not working

I'm stuck on the final step. Whenever I DM the bot with the setup command (in my case !setup), it reacts to my message with a check emoji, but does nothing further. This is what I'm getting from the Heroku logs:

2018-07-29T16:26:23.315324+00:00 app[worker.1]: Ignoring exception in command setup:
2018-07-29T16:26:23.318359+00:00 app[worker.1]: Traceback (most recent call last):
2018-07-29T16:26:23.318526+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 896, in invoke
2018-07-29T16:26:23.318528+00:00 app[worker.1]:     await ctx.command.invoke(ctx)
2018-07-29T16:26:23.318574+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 526, in invoke
2018-07-29T16:26:23.318579+00:00 app[worker.1]:     await self.prepare(ctx)
2018-07-29T16:26:23.318621+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 483, in prepare
2018-07-29T16:26:23.318624+00:00 app[worker.1]:     await self._verify_checks(ctx)
2018-07-29T16:26:23.318668+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 436, in _verify_checks
2018-07-29T16:26:23.318671+00:00 app[worker.1]:     if not (await self.can_run(ctx)):
2018-07-29T16:26:23.318713+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 734, in can_run
2018-07-29T16:26:23.318717+00:00 app[worker.1]:     return (await discord.utils.async_all(predicate(ctx) for predicate in predicates))
2018-07-29T16:26:23.318757+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/utils.py", line 276, in async_all
2018-07-29T16:26:23.318760+00:00 app[worker.1]:     for elem in gen:
2018-07-29T16:26:23.318798+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 734, in <genexpr>
2018-07-29T16:26:23.318801+00:00 app[worker.1]:     return (await discord.utils.async_all(predicate(ctx) for predicate in predicates))
2018-07-29T16:26:23.318839+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 1219, in predicate
2018-07-29T16:26:23.318841+00:00 app[worker.1]:     raise MissingPermissions(missing)
2018-07-29T16:26:23.318906+00:00 app[worker.1]: discord.ext.commands.errors.MissingPermissions: You are missing Administrator permission(s) to run command.
2018-07-29T16:26:23.425442+00:00 app[worker.1]: Ignoring exception in on_message
2018-07-29T16:26:23.425725+00:00 app[worker.1]: Traceback (most recent call last):
2018-07-29T16:26:23.425812+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 220, in _run_event
2018-07-29T16:26:23.425815+00:00 app[worker.1]:     await coro(*args, **kwargs)
2018-07-29T16:26:23.425860+00:00 app[worker.1]:   File "bot.py", line 379, in on_message
2018-07-29T16:26:23.425862+00:00 app[worker.1]:     await self.process_modmail(message)
2018-07-29T16:26:23.425944+00:00 app[worker.1]:   File "bot.py", line 350, in process_modmail
2018-07-29T16:26:23.425951+00:00 app[worker.1]:     channel = discord.utils.get(guild.text_channels, topic=topic)
2018-07-29T16:26:23.426017+00:00 app[worker.1]: AttributeError: 'NoneType' object has no attribute 'text_channels'

Bot doesn't show online

I followed everything step by step on the Heroku guide. This is what I got on the application log:

2018-05-06T16:45:33.864399+00:00 app[worker.1]:     from .http import HttpResponseParser, StreamWriter
2018-05-06T16:45:33.864403+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/aiohttp/http.py", line 8, in <module>
2018-05-06T16:45:33.864523+00:00 app[worker.1]:     from .http_parser import (HttpParser, HttpRequestParser, HttpResponseParser,
2018-05-06T16:45:33.864528+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/aiohttp/http_parser.py", line 15, in <module>
2018-05-06T16:45:33.864657+00:00 app[worker.1]:     from .http_writer import HttpVersion, HttpVersion10
2018-05-06T16:45:33.864661+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/aiohttp/http_writer.py", line 304, in <module>
2018-05-06T16:45:33.864920+00:00 app[worker.1]:     class URL(yarl.URL):
2018-05-06T16:45:33.864925+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/yarl/__init__.py", line 232, in __init_subclass__
2018-05-06T16:45:33.865399+00:00 app[worker.1]:     "is forbidden".format(cls))
2018-05-06T16:45:33.865421+00:00 app[worker.1]: TypeError: Inheritance a class <class 'aiohttp.http_writer.URL'> from URL is forbidden

Having trouble setting up the bot

I'm running the bot from a vps, and when I typed "python3.6 bot.py" it asked for the bot token. After I inputted the token I got

Traceback (most recent call last):
File "bot.py", line 511, in
Modmail.init()
File "bot.py", line 107, in init
raise e
File "bot.py", line 105, in init
bot.run(to_use, activity=discord.Game(os.getenv('STATUS')), reconnect=True)
TypeError: init() takes 1 positional argument but 2 were given
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7efc850bcd30>

How to check the messages users send to bot?

I tried testing the bot by sending message, it responds with a check reaction. But, I don't know how to check the messages and I want to be able to know how to do it. Please respond as soon as possible.

Error when member sends message to Bot

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'

modmail bot not creating new channels

I setup a modmail bot and had the mod mail category and modmail channels all setup and the bot was working. But I figured out that the bot's name wasn't right so I decided to create a new (second) modmail bot with the right name, but when I set it up in the server, it said that this server was already setup, so, I kicked the other old/wrong bot and deleted the channels and categories, and tried again with yet another (third) bot. I set it up in the server, and it created the modmail category and the bot-info channel, but when I DM'd it to test it out, it doesn't respond back with the "thanks for the message!" response. And it also doesn't create any new channel threads. So I was wondering if anyone knows how to fix this. Thanks!

Error in logs

2018-09-17T17:30:50.921828+00:00 app[worker.1]:
2018-09-17T17:32:56.927937+00:00 app[worker.1]: Ignoring exception in on_message
2018-09-17T17:32:56.929175+00:00 app[worker.1]: Traceback (most recent call last):
2018-09-17T17:32:56.941384+00:00 app[worker.1]: await coro(*args, **kwargs)
2018-09-17T17:32:56.941430+00:00 app[worker.1]: File "bot.py", line 379, in on_message
2018-09-17T17:32:56.941376+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 221, in _run_event
2018-09-17T17:32:56.941432+00:00 app[worker.1]: await self.process_modmail(message)
2018-09-17T17:32:56.941469+00:00 app[worker.1]: File "bot.py", line 350, in process_modmail
2018-09-17T17:32:56.941474+00:00 app[worker.1]: channel = discord.utils.get(guild.text_channels, topic=topic)
2018-09-17T17:32:56.941550+00:00 app[worker.1]: AttributeError: 'NoneType' object has no attribute 'text_channels'

Allow welcome message command

For some servers, it might work to have a welcome DM to members with a simple notice without creating an issue channel within the server, unless the person replies in the DM.

For example:

Hello {m}!
Welcome to {s}, please feel free to contact me and I'll rely your message to the Moderators.

Just be sure to use this service appropriately.

Bot not responding to PMs

I've set it up and gave it administrator permissions, double checked Client ID, Bot Token and Guild ID. It created a new channel, bot-info. Whenever someone PMs it, it reacts with a check emoji, but doesn't do anything further. It's supposed to make a new channel when someone PMs it but that's not the case. This is parsed everytime whenever someone PMs it.

2018-07-29T16:51:08.080826+00:00 app[worker.1]: Ignoring exception in on_message
2018-07-29T16:51:08.091621+00:00 app[worker.1]: Traceback (most recent call last):
2018-07-29T16:51:08.092261+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 220, in _run_event
2018-07-29T16:51:08.092263+00:00 app[worker.1]:     await coro(*args, **kwargs)
2018-07-29T16:51:08.092398+00:00 app[worker.1]:   File "bot.py", line 379, in on_message
2018-07-29T16:51:08.092400+00:00 app[worker.1]:     await self.process_modmail(message)
2018-07-29T16:51:08.092750+00:00 app[worker.1]:   File "bot.py", line 350, in process_modmail
2018-07-29T16:51:08.092753+00:00 app[worker.1]:     channel = discord.utils.get(guild.text_channels, topic=topic)
2018-07-29T16:51:08.092829+00:00 app[worker.1]: AttributeError: 'NoneType' object has no attribute 'text_channels'

idea

add an eval command to make it run scripts but make it so that only the owner of the bot can execute it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.