chamburr / modmail Goto Github PK
View Code? Open in Web Editor NEWA feature-rich Discord bot for easy communication between server staff and users.
Home Page: https://modmail.xyz
License: GNU Affero General Public License v3.0
A feature-rich Discord bot for easy communication between server staff and users.
Home Page: https://modmail.xyz
License: GNU Affero General Public License v3.0
Please describe the feature you'd like
Suggestions 516 & 510
on_member_leave
catchPlease describe the feature you'd like
A command or argument to the =logging command to manually select a existing channel either by tag or channel ID for the bot to log in.
Describe the motivation for the feature
Many servers already have logging channels for their other bots, and having the modmail bot add another one adds unnecessary clutter
A more detailed serverinfo command with more useful information
I know that the miscellaneous commands are not used alot but I think it would just be cool having the extra details, would understand if this idea is thought as unnecessary. Anyways, instead of the current "emotes: (total emotes in the guild)"
I think it would be more useful with more info, the extra details would be, amount of animated, normal and total emotes in the guild. I think this would be cool. Also information about the server boost status, maybe? For the details about server emotes (animated, normal and total), you would first have to import this:
from collections import OrderedDict, deque, Counter
Just a small and simple example of the above output and code, (to add on to the current code):
Please describe the feature you'd like
Docker Support for the bot
Describe the motivation for the feature
Making it a more visible 'plan' than being in just the suggestions channel
Please describe the feature you'd like
A footer at the bottom of the help command, pointing out that []
, and <>
surrounding arguments shouldnt be included, and are there solely to show you where to place arguments, and which are and arent required.
Describe the motivation for the feature
suggestion #610
Describe alternatives you've considered
sanitizing them from command parsing, which would prevent them from being used as valid parts of arguments.
Additional context
https://discord.com/channels/576016832956334080/1227384111249756211
Please describe the feature you'd like
If you have premium and close a ticket, the user is sent two messages. Sometimes this can be okay behavior, but in cases where you close a ticket with no reason, then the user does not need to receive two messages.
Describe the motivation for the feature
Reducing messages sent to a user
Describe alternatives you've considered
Not using automatic closing messages
Describe the bug
Activity status isn't showing up as it should. I haven't modified anything.
Here's the code regarding the status:
In config.py
:
# Status of the bot
activity = f"DM to Contact Staff | {default_prefix}help"
In events.py
:
await self.bot.change_presence(activity=discord.Game(name=self.bot.config.activity))
Screenshots:
In config.py
:
In events.py
:
Additional context
I have self-hosted this bot on a Raspberry Pi. I have a bot of my own hosted on a Raspberry Pi already and that is displaying the status correctly, however, I made it using dicord.js instead of discord.py.
Improve the userinfo command
Right now the userinfo command seems kind of boring to be honest, it can be improved alot to make it way more attractive, and I do know that the command is not used alot but it would still be nice to have a nice looking userinfo command in my opinion
As of now, for the "Roles" section in the command, the roles are not mentioned, it looks boring if I'm being honest, and also there is a section of "Status" (which is idle, do not disturb or online) which I feel is unnecessary and can be replaced my "Nickname".
I have coded my ideas for you to look through and it would be appreciated if you consider it thanks :)
For comparision, this is the difference (my one is by Test Bot")
Edit:
It would have to be updated to
roles = member.roles[0:]
So that it shows the "@everyone" role
Hi,
If a member raises a modmail, is banned, and then the modmail is closed afterwards, the line here:
Line 70 in 651d15f
will mean that an error is thrown:
2021-04-03T15:40:40.214229764Z [Cluster 1] Traceback:
2021-04-03T15:40:40.214233302Z [Cluster 1] File "/usr/local/lib/python3.8/dist-packages/discord/ext/commands/core.py", line 85, in wrapped
2021-04-03T15:40:40.214236122Z [Cluster 1] ret = await coro(*args, **kwargs)
2021-04-03T15:40:40.214238968Z [Cluster 1] File "/modmail/modmail/cogs/core.py", line 181, in close
2021-04-03T15:40:40.214241777Z [Cluster 1] await self.close_channel(ctx, reason)
2021-04-03T15:40:40.214250098Z [Cluster 1] File "/modmail/modmail/cogs/core.py", line 70, in close_channel
2021-04-03T15:40:40.214253042Z [Cluster 1] member = await ctx.guild.fetch_member(tools.get_modmail_user(ctx.channel).id)
2021-04-03T15:40:40.214256614Z [Cluster 1] File "/modmail/modmail/classes/guild.py", line 86, in fetch_member
2021-04-03T15:40:40.214268363Z [Cluster 1] data = await self._state.http.get_member(self.id, member_id)
2021-04-03T15:40:40.214271118Z [Cluster 1] File "/usr/local/lib/python3.8/dist-packages/discord/http.py", line 250, in request
2021-04-03T15:40:40.214273671Z [Cluster 1] raise NotFound(r, data)```
and more importantly, that no logs are output.
Please describe the feature you'd like
A way to close a ticket without sending any confirmation messages to the user who opened the ticket
Describe the motivation for the feature
Sometimes you forget a ticket for so long and you don't want to close it and remind the person that you suck.
Sometimes people open a second ticket saying "Thanks" and you just want to close it, but sending them another message might prompt them to respond again.
Or maybe you just really don't want to talk to a user.
Describe alternatives you've considered
Alternative is to delete the channel, but then you don't get a transcript saved to your log channel, which is useful.
Taken from Suggestion #438 in Discord
Please describe the feature you'd like
Allow users to open ModMails using a button like so:
Perhaps we could only add this in a channel with setup if that makes it easier to implement.
Also add a command that can be used in a server to create a ticket for that server.
Implement with Slash commands so that messages can be ephemeral and secret to avoid sharing details w/ other server members.
TODO After d.py2.1+ update
Additional context
Approved by Chamburr, making issue for tracking purposes
Describe the bug
If a user is not in the server when staff use the whitelist command then the command fails because it cannot retrieve the member.
To Reproduce
Steps to reproduce the behavior:
whitelist
command to whitelist the IDExpected behavior
The bot should accept a discord.user
argument instead of a member argument
OR
the error message should be updated to state that the member was not found in the server but that the user has been removed from the blacklist.
Additional context
Add any other context about the problem here.
Please describe the feature you'd like
Check to see if the user is on more than one server that Modmail uses. If so ask what server to send the message to.
Describe the motivation for the feature
I have this bot on two servers. Because of that when I want to test I have to use a command to make it send to the right server.
Describe alternatives you've considered
Looking for another bot that does this feature or use another bot on the other server.
Additional context
I think this will help a lot and cut down on false tickets when they are not even wanting to send a ticket to that server.
Please describe the feature you'd like
A way to enable/disable modmails ability to receive tickets for a server. The commands could look like =enable [reason]
or =disable [reason
(I'm sure there are better options). One user suggested the reason parameter could be its own command and be a premium feature
Describe the motivation for the feature
per approvec suggestions 216 and 217 - Not all servers want to have their ticket desk open 24/7
Please describe the feature you'd like
An optional reason parameter for the =block
and =unblock
so staff can remember why they blocked someone. This is definitely more useful for older blocks.
Describe the motivation for the feature
Useful for informing other staff members why a member was blocked.
Please describe the feature you'd like
A way to set an automatic reply message to send to a user before the issue is submitted for server staff to review. It should be something staff members can set. When user first contacts modmail, they will automatically be sent this FAQ to read over, and if it doesn't solve their issue, the user should reply again to submit their issue.
Describe the motivation for the feature
I help run a official game server, and we get a lot of modmail submissions on topics we can't help with because people assume the volunteer staff are official employees. it would help minimize the amount of clutter we deal with daily.
Please describe the feature you'd like
An optional channel argument for the =logging
command which will allow users to input their own channel to the command. The command could look like =logging [channel]
. If the channel is given then it will log the given channel in the database and if not it will create the channel.
Describe the motivation for the feature
Per approved suggestion 246
Describe the bug
Self-hosting on MacOS no longer works due to recent changes to prometheus.py
.
This utility now attempts to open /proc/stat
which does not exist in MacOS, and does not handle the error gracefully.
[Cluster 1] Traceback (most recent call last):
[Cluster 1] File "/Users/Nelluk/Documents/ProgrammingProjects/discord_bots/modmail-pc-2/main.py", line 67, in <module>
[Cluster 1] loop.run_until_complete(bot.start_bot())
[Cluster 1] File "/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
[Cluster 1] return future.result()
[Cluster 1] File "/Users/Nelluk/Documents/ProgrammingProjects/discord_bots/modmail-pc-2/classes/bot.py", line 102, in start_bot
[Cluster 1] await self.connect_prometheus()
[Cluster 1] File "/Users/Nelluk/Documents/ProgrammingProjects/discord_bots/modmail-pc-2/classes/bot.py", line 95, in connect_prometheus
[Cluster 1] self.prom = prometheus.Prometheus(self)
[Cluster 1] File "/Users/Nelluk/Documents/ProgrammingProjects/discord_bots/modmail-pc-2/utils/prometheus.py", line 22, in __init__
[Cluster 1] with open(os.path.join("/proc", "stat"), "rb") as stat:
[Cluster 1] FileNotFoundError: [Errno 2] No such file or directory: '/proc/stat'
[Cluster 1] ERROR:asyncio:Unclosed client session
[Cluster 1] client_session: <aiohttp.client.ClientSession object at 0x10494ce80>
[Cluster 1] ERROR:asyncio:Exception in default exception handler
For the "viewsnippet" command, it would be nice and much easier in my opinion if it stated the number of existing snippets, preferably in square brackets since I think it looks the best, next to the embed title of "Snippets"
An example would be:
Snippets [3]
[the first snippet name]
[the first snippet content]
And so on
Code:
all_pages = []
for chunk in [res[i : i + 10] for i in range(0, len(res), 10)]:
page = Embed(title=f"Snippets [{len(res)}]")
With the launch of new Discord features, we should update ModMail to utilise them.
Please describe the feature you'd like
A way to transfer tickets between different staff departments (moderators, sales, support, admins etc). =transfer <role>
could be the command.
Describe the motivation for the feature
Per approved suggestion 175 (it's marked as implemented but i think that's a mistake) - _Add a transfer command. This would be useful if the ModMail is used by different staff departments in the server, plus there's no other ModMail public bots with that feature. How would it work? When a ticket is open, the default support roles will be able to see it, then they could do =transfer and that would display a message saying the user is being transferred to that role and would allow people that has the target role to see and type in the channel and would also ping that role. I'm sorry if my explanation is a bit confusing but i hope you understand.
_
Addidional Context
This suggestion was also raised in this message before carl's suggestions were added, back when V2 was still in development.
Please describe the feature you'd like
Instead of the logging command deleting the current modmail-logs channel, it would make more sense if it kept the channel but disabled future conversations from being logged when they're closed.
Describe the motivation for the feature
The current documentation does not mention that running the command will delete the existing log channel, but instead suggests that the command will just prevent future conversations from being logged without deleting the channel.
Action Plan
Add an additional column in the database which stores if users wish to have their conversations logged in the channel. Change the =logging
function to enable or disable this flag, and then change the closing functions to check for True or False instead of None/Channel.
Describe the bug
When using a modmail command in a ticket, with a bot-ping as the prefix, it sends the message of the command ran.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The user doesnt receive the message, as its a command.
Additional context
Add any other context about the problem here.
Please describe the feature you'd like
Suggestion #523 - add webhook support for message log
TODO after d.py2.1 migration
Please describe the feature you'd like
Suggestion 500 (and many more)
Add a command that can be used in a server to create a ticket for that server
Implement with Slash commands so that messages can be ephemeral and secret to avoid sharing details w/ other server members
TODO d.py2.1+ upgrade
Please describe the feature you'd like
Allow users to send messages anonymously or the server mods being able to turn it on as whole
Describe the motivation for the feature
Allows members to share more sensitive information with moderators if needed
Describe alternatives you've considered
Already forked code and begun trying to do it myself as a learning experience
Additional context
nope
Please describe the feature you'd like
If we could get the ability to assign a user to a ticket that would be awesome.
Currently, when a ticket is generated, it's viewable by a role (e.g Support Team), Having the ability to assign to a specific user or role from that point onward would help when dealing with a request such as
Describe the motivation for the feature
Currently within our community tickets are generated and the whole support team is able to interact with these, we are looking to expand on this system and allow suggestion/complaints about a staff member who are being disrespectful etc. Having the ability to assign tickets to either the SM (Myself) or our dev team (@dev Team) once it comes into the support team would help enhance our process flows.
Describe alternatives you've considered
Alternative to this, I've thought about getting a custom bot developed to meet our community needs.
Is the plan to use buttons for things like the server select menu?
Or the dropdown text-selection menus that are offered as well with the update?
Please describe the feature you'd like
A way to 'subscribe' to tickets so that you get a ping notification when someone replies to a ticket after 6 or so hours.
Describe the motivation for the feature
Per approved suggestion 122 useful if you're dealing with someone, but they are slow on responding.
For the "permissions" command, I think that it would be a nice addition if you can add a channel argument, so it would be something like this:
async def permissions(ctx, member : discord.Member=None, channel : discord.TextChannel=None)
If no member was passed, it would be the member invoking the command and if no channel was passed, it would show the guild permissions of a member, whilst if a channel is passed it would show the channel permissions for that member.
The only alternative to get this type of information is through going through the settings which can take time, or using the "View Server as Role" feature, making this command more efficient.
I can make a rough command if needed
It would be good to have a channel command so users can create the support ticket rather than direct messaging the bot.
For example
/staffmsg I'm being bullied can we chat
This would do the same thing as messaging the bot directly.
Reason for this comes from privacy concerns users of my server have with the ModMail bot wanting access to their channel lists or not wanting to DM the bot directly.
Here's a comment from a user.
Says it needs to be able to see my entire servers list, which I am not really comfortable it knowing tons about me
You can get past that by
=send ServerID message
Another mentioned he didn't want to message the bot directly.
So with a openticket command it would open the channel automatically without having to go through the bot user.
Looked at mee6 custom commands as well as read through the command list a few times.
Please describe the feature you'd like
A note attached to the footer of the server selection menu saying that the user's options will not change when there are 10 or fewer servers (one page) shown.
Describe the motivation for the feature
Per approved suggestion 321. - Users report that the page reactions are confusing when opening a ModMail, especially if they only belong to one server or few enough servers that multiple pages do not appear.
Describe alternatives you've considered
Numbering the pages and included a total page number or just not adding the โโถ reactions and the Use the reactions to flip pages
message for lists that contain 10 or fewer servers
Describe the bug
Currently there's nothing that explains how this isn't a scam. It's definitely a massive privacy risk tho.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
The bot should not need access to users' accounts for its functionality. There is no explanation anywhere about why it does so.
Screenshots
If applicable, add screenshots to help explain your problem.
N/A
Additional context
Add any other context about the problem here.
Neither the privacy policy nor the terms of service, as posted on the website, address the bot's features and functionality at all.
Please describe the feature you'd like
Would be great for user Server, which uses matrix bridge to contact modmail with a Matrix address.
Describe the motivation for the feature
Reduce the dependence of Discord
Describe alternatives you've considered
Not using modmail
Please describe the feature you'd like
A way to add a time duration to the =block
and =unblock
commands. Somehting like =tempblock <user> <time>
or `=block <user [time].
Describe the motivation for the feature
It will help alleviate the need for staff to remember to unblock users or to use third-party bots to set reminders for how long someone has been blocked. I also think it could tie in well with #101 with the command looking something like `=block [time] [reason].
Describe the bug
Servers who are in the Discovery queue cannot have channels with inappropriate names (swears, slurs, etc).
Expected behavior
In the event that a channel cannot be created, then the channel name should something generic like ticket
, and the server staff can rename the ticket if needed. It would be better to keep track of how many tickets have been created in a server and rename a ticket to ticket-001
, but this requires altering the database again and this issue isn't big enough for this kind of change.
Any chance there can be a build for the arm64 architecture so this can run on a Raspberry Pi via docker?
Or documentation on how to build and run it without docker would be nice.
Please describe the feature you'd like
A button on messages modmail sends, that when clicking them, it replies (ephemerally, which is part of the motivation for buttons) with a plain message with the message content.
Describe the motivation for the feature
Suggestion #203
Suggestion #232
Suggestion #351
Discord on ios doesnt play nicely with embeds and copying content from them, but it works fine on actual messages, using the "Copy Text" button
This would also be useful when copying content such as on snippets, where on desktop, you cant easily copy markdown inside embeds.
Describe alternatives you've considered
Dont use embeds, which is just stupid. (ex. Suggestion #222, or almost any occurrence of "Compact mode")
Additional context
Buttons will most likely be standard for most things once #162 is resolved, so this obviously isnt viable until after then.
Please describe the feature you'd like
I am a community manager for a very large discord, and we regularly reach the max channels per category limit, meaning that users cannot open new tickets, and get frustrated at this. It might be useful to have a 'ticket backlog' such that if the max tickets open is reached, any new users trying to open tickets go on a 'backlog' so that when one ticket is closed, the next ticket on the backlog is opened automatically. The bot would inform the user what position in the queue they're in and that they've been placed in the queue.
Describe the motivation for the feature
Users would spam the bot less, would feel more that they're being looked after and getting tickets in at busy times would be less RNG.
Describe alternatives you've considered
We've tried hacking our way around the 50 channels limit by making another bot of ours move modmail channels into a different category, basically giving us ~100 tickets open - this just gets filled as well and the mods get demotivated as we have a gigantic wall of tickets.
Additional context
Would need a toggle on/off for this feature, potentially a way for mods to look at the queue and remove people from it/block people from clogging it up due to misuse. Perhaps a rough waiting time given an estimation over the last X minutes/hours of tickets per hour, but obviously with the caveat that it's an estimation and not a promise - perhaps this message could be customised too.
By putting the entire application into a docker container, it will become more versatile and accessible for those who wish to develop and test locally. Using a docker container, the application can also be run on windows using the Windows Subsystem for Linux. Additionally, the dockerfile would allow the docker build to automatically install and configure the required applications {Python, PostgreSQL, and Redis} as well as install all the required modules
Describe the bug
If a user deletes the modmail category and logging channel, then if they run the =category
command the bot will only create the new category. To increase the end user experience, the bot should check for if a logging channel already exists. If it does, the bot should move it into the new category. If it does not exist, the bot should create a new logging channel.
To Reproduce
Steps to reproduce the behavior:
Run =setup
Delete category + logging channel
Run =category <name>
Expected behavior
It would be expected that the =category
command functions similarly to the =setup
command if =logging
is enabled and there is not a logging channel currently in the server.
Please describe the feature you'd like
A command to allow staff with an accessrole to open a ticket with specific member of the server with a command like =open <member>
Describe the motivation for the feature
Sometimes staff need to be proactive and start conversations with members involved in issues. Currently the only way to facilitate this is to ask the user to DM the ModMail bot to start a ticket, so adding a method for staff to open a new ticket with a specific user would streamline the process and make it much more professional feeling.
Please describe the feature you'd like
A setting/command which allows staff to select which roles can/can't use the ticketing system. Meaning only users with an 'allowed' role can create tickets and if a user has a 'denied' role then the bot acts as if the user is blocked from the ticketing system.
Describe the motivation for the feature
Per suggestion 62 - Useful for blocking trolls/raiders/self-bots from using the ticketing system
Describe alternatives you've considered
Allowing servers to block roles in the =block
/=unblock
command.
Please describe the feature you'd like
Currently, sending a message without the Modmail prefix in a channel will automatically send a message to the user, which could result in messages being sent accidentally to the user that may not be well received. Add a command which will require messages to be sent to a user using the =reply
or =areply
commands, and all other messages will be ignored.
Describe the motivation for the feature
It's a feature that's been requested multiple times throughout the years, but has never been implemented. Adding it as an optional feature for servers to enable or disable would help to prevent messages being accidentally sent through the system that the staff of a server may not want.
I posted this in the support discord as well, but found the github tracker afterwards and wanted to include here for easier tracking
Describe the bug
If a user replies to a DM from the bot rather than just sending a message in the DM conversation, the confirmation/server-select dialog appears as intended, but the bot does not seem to notice reactions to it and times out
To Reproduce
(see screenshots)
Expected behavior
The bot should either forward the message as expected, or notice that the message is a reply, and explain this limitation to the user and ask that their messages not be replies to individual bot messages.
Additional context
Unsure if this is an unintended bug or known limitation, but it would be great to have additional guidance for inexperienced users if this isn't an easily-fixable problem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.