Giter Club home page Giter Club logo

modmail's Introduction

Hey there ๐Ÿ‘‹

My name is Sam and I am a college student studying Electrical and Computer Engineering.

๐Ÿ”ญ My passions lie in broadcast A/V technology, esports, embedded systems, robotics, and IT. I also enjoy making Discord bots in my free time. I am also the Operations Director for the Pacific Esports League.

๐ŸŒฑ I am learning frontend development for fun, and working on more MCU based side projects.

modmail's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar saamstep 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

Watchers

 avatar

modmail's Issues

[BUG] - Short desc

C:\Users\Saksham\Desktop\New folder\node_modules\discord.js\src\rest\RequestHandler.js:154
throw new DiscordAPIError(request.path, data, request.method, res.status);
^

DiscordAPIError: Invalid Form Body
embed.footer.icon_url: Scheme "null" is not supported. Scheme must be one of ('http', 'https').
embeds[0].footer.icon_url: Scheme "null" is not supported.

I'm getting this error while running the code i guess you should upgrade discord.js module as v12 is no longer supported

Idea

Suggestions:
Use comands:
!setcategory (ID)
!setlogchannel (ID)
!reply (Replies to a thread)
!close (time)
!snippets (In thread commands)
!move (Moves to a Category)
!suspend (Suspends a thread(
!unsuspend (Unsuspends a thread)
!block (Blocks a user from using modmail)

Console error

Hello, i can't start the bot because of this error

[Login] Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.

I searched everything but i don't find anything.

Could you help me?

A Discord Help Support Server?

Hey there , I really loved the code , however would it be possible for you to make a Discord Support server for the code and we could reach out for help , also a Youtube video describing how to setup the bot will be highly appreciated. Thanks!

Fixed `announce.js` command...

There was a bit of trouble with Modmail announce.js code so here's my spin on it to help with the issue:

const { Command } = require("discord.js-commando");

module.exports = class announceCommand extends Command {
  constructor(client) {
    super(client, {
      name: "announce",
      group: "admins",
      memberName: "announce", 
      throttling: {
          usages: 2,
          duration: 5,
			},
      description: "Make a formatted announcement using embed data", 
      args: [
        {
          key: "option",
          prompt: "Please choose a valid option \`edit, append, embed\`",
          type: "string",
          oneOf: ["edit", "append", "embed"],
        },
        {
          key: "id",
          prompt: "Please provide a message id to edit or mention a channel to send this message to",
          type: "string",
          validate: (id) => {
            if(id.match(/^[0-9]*$/)) {
              return true;
            } else {
                return "Please enter a proper snowflake!"
            }
          }
        },
        {
          key: "title",
          prompt: "Please provide some title text.",
          type: "string",
          validate: (title) => {
            if (title.length < 256) {
              return true;
            } else {
                return "Please enter embed title under 256 characters!"
            }
          }
        },

        {
          key: "body",
          prompt: "Please provide some body text.",
          type: "string",
          validate: (body) => {
            if (body.length < 2048) {
              return true;
            } else {
                return "Please enter embed description under 2048 characters!";
            }
          }
        },
        {
          key: "color",
          prompt: "Please provide some color.",
          type: "string",
        },
        {
          key: "image",
          prompt: "Please provide an image URL.",
          type: "string",
          validate: (image) => {
            if (image.match(/([a-z\-_0-9\/\:\.]*\.(jpg|jpeg|png|gif))/i)) {
              return true;
            } else {
                return "Please enter a proper image URL with the listed extensions!";
            }
          }
        },
        {
          key: "footer",
          prompt: "Please provide some footer text.",
          type: "string",
          validate: (footer) => {
            if (footer.length < 2048) {
              return true;
            } else {
                return "Please enter embed footer under 2048 characters!";
            }
          }
        },
 
      ],
    });
  }

  async run(message, { option, id, title, body, color, image, footer }) {
    switch (option) {
      case "edit":
        try {
          message.channel.messages.fetch(id).then((m) => {
            m.edit({
              embed: {
		title: title,
                description: body,
		color: color,
		footer: footer,
		image: image
              },
            });
          });
        } catch (e) {
          return this.client.error(e + "Channel not found, you must run in same channel as message!", message);
        }
        break;
      case "append":
        try {
          message.channel.messages.fetch(id).then((m) => {
            m.edit({
              embed: {
                description: m.embeds[0].description + " " + body,
              },
            });
          });
        } catch (e) {
          return this.client.error("Channel not found, you must run in same channel as message!", message);
        }
        break; 
      case "embed":
        try {
          let announceChannel = this.client.channels.cache.get(`${id.replace(/</g, "").replace(/>/g, "").replace(/#/g, "")}`);
          announceChannel.send({ embed: { title: title, description: body, image: { url: image }, footer: { text: footer }, color: color } });
        } catch (e) {
          return this.client.error(e, message);
        }
        break;    }
    message.delete();
  }
};

Let me know your thoughts boss :)

most ticket commands are not working

well i noticed that the snippets command is working but noone can use the created snippets as we tried many time by snippet with/without prefix with all possible syntaxes but not working (of course both in ticket and non-ticket channels) , also the close and cmds commands are the same but others looks ok

also no console error at all, seems that commands are not defined at all

replit
Node JS v12.22.6
NPM v6.14.15
discord.js v12.5.2
bot v2.1.2
no error

what should i do? is it a bug or i missed something?

Is this v13?

Hey! I just wanted to ask, is this bot is v13 or v12? I cannot seem to make the bot function when its online.

Suggestion

I would like:

  • We can choose the type of status (watch, listen ...)
  • We can choose the rotation time of the status (for my part, I would like 3 seconds)
  • The bot be adapted with Nodejs V12

Here is my opinion, I hope that some of these features will be present during the next update.

[UPDATE] New Re-write coming soon

In light of DiscordJS v13 and seeing a lot of changes I want to make internally I am in the process of re-writing this bot. No exact update or timeline just yet, but be on the lookout for a huge update!

[READ ME] Before submitting an issue

What goes in Github Issues

  • Bug reports
  • Suggestions
  • Documentation clarifications

What does not go in a Github Issue

  • Asking for help with any errors or bot functions
  • Asking questions that can be answered or found in the readme.md
  • Anything unrelated to the Modmail project

Issues

If you are having an issue you have come to the right place! Please be as specific as possible include the following with your issue:

Operating System/Host info
NodeJS version
NPM version
DiscordJS version
Bot version (found with [p]bot command where [p] means prefix)
Any errors/log output that appeared in the console

Simply saying "it is not working" is not helpful to me. Please make sure you provide the information above!

Click Here to create your first issue

Suggestions

If you have a suggestion please be as descriptive and as possible when making a suggestion. If you have feedback constructive feedback is very helpful and taken!
Click here to send feedback or make a suggestion

Help wanted

When I use repl, since I'm not going to host myself until I'm sure it works, when I hit start I get this.
image

Import the repo to repl, press start.

For it to not send this error and work.

Already at the top.

Error

(node:2356) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channels' of undefined
    at hasCategory (C:\Users\olebo\OneDrive\Dokumente\GitHub\FormelS\discord\index.js:766:13)
    at CommandoClient.<anonymous> (C:\Users\olebo\OneDrive\Dokumente\GitHub\FormelS\discord\index.js:907:9)
    at CommandoClient.emit (events.js:327:22)
    at MessageCreateAction.handle (C:\Users\olebo\OneDrive\Dokumente\GitHub\FormelS\discord\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\olebo\OneDrive\Dokumente\GitHub\FormelS\discord\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\olebo\OneDrive\Dokumente\GitHub\FormelS\discord\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\olebo\OneDrive\Dokumente\GitHub\FormelS\discord\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\olebo\OneDrive\Dokumente\GitHub\FormelS\discord\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\olebo\OneDrive\Dokumente\GitHub\FormelS\discord\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (events.js:315:20)
This error is spammed in the console
It's about this line:
  // check if guild modmail category exists
function hasCategory(g) {
 if (g.channels.cache.find((ch) => ch.id == client.config.modmail.category || ch.name == client.config.modmail.category)) {
   return true;
 } else {
   return false;
 }
}

[BUG] - Issue with DM bot.

Describe the bug
Writes DM to BOT and this error appears in PuTTY.

To Reproduce
Steps to reproduce the behavior:

  1. Start the bot
  2. DM the bot and type: hi
  3. get an error about 'id'

Console/Error logs

(node:910395) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
    at CommandoClient.<anonymous> (/home/marc/modmail/index.js:449:112)
    at CommandoClient.emit (events.js:387:35)
    at MessageCreateAction.handle (/home/marc/modmail/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/home/marc/modmail/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/home/marc/modmail/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/home/marc/modmail/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/home/marc/modmail/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/home/marc/modmail/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (events.js:375:28)
    at Receiver.receiverOnMessage (/home/marc/modmail/node_modules/ws/lib/websocket.js:970:20)

System Info

Operating System/Host info: Ubuntu 20.04
NodeJS version: 14.17.3
NPM version: 6.14.13
DiscordJS version: 12.5.3
Bot version: 2.1.2

Replit Issue

While the console is almost done installing packages, it keep saying replit package operation failed.

Missing script

Describe the bug
Missing the start script
To Reproduce
Steps to reproduce the behavior:

  1. Start bot

Expected behavior
I started the bot and it is saying it's missing teh start script

Console/Error logs
๎บง npm start
npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-03-02T13_59_24_018Z-debug.log

System Info

repl.it
12.16.1
6.14.6
discord.js-commando version 0.12.2
2
missing script: start
Additional context
Add any other context about the problem here.

Ignoring DMS

(node:236) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channels' of undefined at hasCategory (/home/runner/modmail/index.js:283:9) at CommandoClient.<anonymous> (/home/runner/modmail/index.js:420:9) at CommandoClient.emit (events.js:327:22) at MessageCreateAction.handle (/home/runner/modmail/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14) at Object.module.exports [as MESSAGE_CREATE] (/home/runner/modmail/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32) at WebSocketManager.handlePacket (/home/runner/modmail/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31) at WebSocketShard.onPacket (/home/runner/modmail/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22) at WebSocketShard.onMessage (/home/runner/modmail/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10) at WebSocket.onMessage (/home/runner/modmail/node_modules/ws/lib/event-target.js:125:16) at WebSocket.emit (events.js:315:20) (node:236) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:236) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

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.