GithubHelp home page GithubHelp logo

sayrix / ticket-bot Goto Github PK

View Code? Open in Web Editor NEW
433.0 9.0 250.0 1015 KB

Discord ticket bot with buttons, slash commands, select menus, modals, and transcripts system made with Discord.js v14

Home Page: https://doc.ticket.pm

License: Creative Commons Attribution 4.0 International

TypeScript 99.15% Shell 0.85%
ticket-bot ticket-bot-discord ticket-discord-bot discord-bot discord-ticket-bot discord-ticket discord bot discord-js tickets

ticket-bot's Introduction

Hi πŸ‘‹, I'm Sayrix

πŸ”— Connect with me:

sayrixfx sayrix jNKdusJ s4yrix

βš™οΈ Tools:

github git photoshop illustrator VsCode

🚩 Projects:

πŸ“œ Other:

Code Time

Lines of code

πŸ“Š This Week I Spent My Time On

πŸ’¬ Programming Languages: 
TypeScript               4 hrs 1 min         β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘   80.89 % 
Other                    27 mins             β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   09.06 % 
JavaScript               18 mins             β–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   06.12 % 
JSON                     11 mins             β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   03.82 % 
HTML                     0 secs              β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘   00.07 % 

github-views

ticket-bot's People

Contributors

0x7da avatar 13mrblackcat13 avatar ajnebalreves avatar avery1227 avatar battutdev avatar bimoware avatar dacaly avatar darkichjs avatar dependabot[bot] avatar dh2-io avatar donpedrotv avatar fossabot avatar goustkor avatar itsmatiascc avatar jozo233 avatar m3rcena avatar musiker15 avatar nicolasbaud avatar okunamayanad avatar owenbellowen avatar pc1up avatar psyloz avatar rafaelhgoliveira avatar romadevworld avatar sayrix avatar thomasbnt avatar uo1428 avatar zhiyan114 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

ticket-bot's Issues

DiscordAPIError[10002]: Unknown Application

Hey!

I got this error:

DiscordAPIError[10002]: Unknown Application
    at SequentialHandler.runRequest (C:\Users\membe\Desktop\BloomBot\ticket-bot-main\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:198:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (C:\Users\membe\Desktop\BloomBot\ticket-bot-main\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js:99:20) {
  rawError: { message: 'Unknown Application', code: 10002 },
  code: 10002,
  status: 404,
  method: 'put',
  url: 'https://discord.com/api/v9/applications/959566320310050896/commands'
}

when i use the "node deploy-commands.js"

can anybody help me?

Ticket can't be deleted and no logs is generated

Stuck at "Sauvegarde des messages..."

CONSOL:

 (node:922) DeprecationWarning: Passing strings for MessageEmbed#setAuthor is deprecated. Pass a sole object instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:922) DeprecationWarning: Passing strings for MessageEmbed#setFooter is deprecated. Pass a sole object instead.
/home/container/events/interactionCreate.js:266
            client.channels.cache.get(client.config.logsTicket).send({
                                                                ^

TypeError: client.channels.cache.get(...).send is not a function
    at /home/container/events/interactionCreate.js:266:65
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Cant delte tickets

After some time of the tickets being created the members cannot delete it and it gives this error within the console

TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
11|smticke | at Function.resolve (/root/smticket/node_modules/discord.js/src/structures/PermissionOverwrites.js:184:28)
11|smticke | at /root/smticket/node_modules/discord.js/src/structures/GuildChannel.js:318:87
11|smticke | at Array.map ()
11|smticke | at TextChannel.edit (/root/smticket/node_modules/discord.js/src/structures/GuildChannel.js:318:57)
11|smticke | at InteractionCollector. (/root/smticket/events/interactionCreate.js:205:16)
11|smticke | at InteractionCollector.emit (node:events:402:35)
11|smticke | at InteractionCollector.handleCollect (/root/smticket/node_modules/discord.js/src/structures/interfaces/Collector.js:109:12)
11|smticke | at runMicrotasks ()
11|smticke | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
11|smticke | [Symbol(code)]: 'INVALID_TYPE'
11|smticke | }
11|smticke | (node:27848) DeprecationWarning: Passing strings for MessageEmbed#setAuthor is deprecated. Pass a sole object instead.
11|smticke | (Use node --trace-deprecation ... to show where the warning was created)
11|smticke | (node:27848) DeprecationWarning: Passing strings for MessageEmbed#setFooter is deprecated. Pass a sole object instead.

Can't Launch Bot

When i try to launch the bot i get errors?
Errors:
C:\Users\USERNAME\Desktop\s1ayze#4573-bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:245
throw new Error(WSCodes[error.code]);
^

Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
at WebSocketManager.createShards (C:\Users\USERNAME\Desktop\s1ayze#4573-bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:245:15)
at async Client.login (C:\Users\USERNAME\Desktop\s1ayze#4573-bot\node_modules\discord.js\src\client\Client.js:254:7) {
[Symbol(code)]: 'DISALLOWED_INTENTS'
}

Node.js v18.6.0

Can't do slash command

Hello I'm using node.js v16.15.1 and I can't start deploy-commands.js
index js - ticket-bot-main - Visual Studio Code 25 07 2022 19_45_32 (2)
I have applications.commands on my server

Not Worked Slash Commands

deploy-commands
already start deploy-commands, but the commands in the bot is not show as suggestion like in ur video

error
and how to resolve this ?

fix pls

npm WARN deprecated @sapphire/[email protected]: This version has been automatically deprecated by @favware/npm-deprecate. Please use a newer version.
npm WARN deprecated [email protected]: No longer supported. Install the latest release (0.20.2)
npm WARN deprecated [email protected]: No longer supported. Instal

Ticket maximum -future request

Would it be possible to add a variable that indicates how many tickets there can be from one person? I mean that I can now open, let's say 5, tickets before the message comes that I can no longer open tickets?

Close Ticket don't work

Here my error

/app/node_modules/got/index.js:115
err = new got.ParseError(e, statusCode, opts);
^
ErrorClass [ParseError]: Unexpected token '<' at 1:1 in https://hastebin.com/documents

^
at /app/node_modules/got/index.js:115:12
at BufferStream. (/app/node_modules/read-all-stream/index.js:64:3)
at BufferStream.emit (node:events:525:35)
at finishMaybe (/app/node_modules/readable-stream/lib/_stream_writable.js:630:14)
at endWritable (/app/node_modules/readable-stream/lib/_stream_writable.js:638:3)
at BufferStream.Writable.end (/app/node_modules/readable-stream/lib/_stream_writable.js:594:41)
at IncomingMessage.onend (node:internal/streams/readable:693:10)
at Object.onceWrapper (node:events:627:28)
at IncomingMessage.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1358:12) {
host: 'hastebin.com',
hostname: 'hastebin.com',
method: 'POST',
path: '/documents',
statusCode: 503,
statusMessage: 'Service Unavailable'

Error that cause no ticket close and no logs

if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');

it is in permissionoverwrite js:186
Everything os alright, but sometimes it just broke itself. And only way to fix it is to clear tickets without the bot and then restart it!

Error starting the bot

Someone can help me with this error?

C:\Users\Joao\Documents\bot-faithmc\node_modules\discord.js\src\client\websocket\WebSocketManager.js:245
throw new Error(WSCodes[error.code]);
^

Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
at WebSocketManager.createShards (C:\Users\Joao\Documents\bot-faithmc\node_modules\discord.js\src\client\websocket\WebSocketManager.js:245:15)
at async Client.login (C:\Users\Joao\Documents\bot-faithmc\node_modules\discord.js\src\client\Client.js:254:7) {
[Symbol(code)]: 'DISALLOWED_INTENTS'
}

Syntax Error

when starting program in nodejs this comes "Uncaught SyntaxError: Invalid or unexpected token" tokens are filled in properly

when running programm on jshint this errorΒ΄s are found:

Two warnings

20 | 'template literal syntax' is only available in ES6 (use 'esversion: 6').
19 | Unrecoverable syntax error. (73% scanned).

La methode pour corriger les commandes /

Les commandes ne sont disponibles que si votre bot a des autorisations "scopes" lui permettant, aller donc dans votre developper portal et dans OAuth2, puis choisissez vos scopes. Copiez l'adresse en bas et cliquez dessus pour inviter votre nouveau bot avec les autorisations ! Tout devrez Γͺtre fonctionnel ensuite. Cela devrez donner un truc du style :
image

Bot launch problem

Hello, I can't launch the bot with both commands. Here is the error message

DiscordAPIError[20012]: You are not authorized to perform this action on this application
at SequentialHandler.runRequest (/home/debian/botticket/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.js:198:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (/home/debian/botticket/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.js:99:20) {
rawError: {
message: 'You are not authorized to perform this action on this application',
code: 20012
},
code: 20012,
status: 403,
method: 'put',
url: 'https://discord.com/api/v9/applications/924674961958912010/commands'
}

Option to put more tickets

How can you set the limit of tickets per user? There is only one per user, but I would like more to be created. Can you help me?

Bonsoir! J'ai un problème avec ton bot !

C:\Users\User\Music\Bot discord\ticket-bot-main>

C:\Users\User\Music\Bot discord\ticket-bot-main>node index.js
Ticket Bot ready!
Thank you very much for using Ticket Bot! Developed with the ❀️ by Sayrix
(node:21752) DeprecationWarning: Passing strings for MessageEmbed#setAuthor is deprecated. Pass a sole object instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:21752) DeprecationWarning: Passing strings for MessageEmbed#setFooter is deprecated. Pass a sole object instead.
C:\Users\User\Music\Bot discord\ticket-bot-main\node_modules\discord.js\src\structures\PermissionOverwrites.js:184
if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
^

TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
at Function.resolve (C:\Users\User\Music\Bot discord\ticket-bot-main\node_modules\discord.js\src\structures\PermissionOverwrites.js:184:28)
at C:\Users\User\Music\Bot discord\ticket-bot-main\node_modules\discord.js\src\managers\GuildChannelManager.js:141:81
at Array.map ()
at GuildChannelManager.create (C:\Users\User\Music\Bot discord\ticket-bot-main\node_modules\discord.js\src\managers\GuildChannelManager.js:141:51)
at Object.execute (C:\Users\User\Music\Bot discord\ticket-bot-main\events\interactionCreate.js:15:34)
at Client. (C:\Users\User\Music\Bot discord\ticket-bot-main\index.js:29:46)
at Client.emit (node:events:402:35)
at InteractionCreateAction.handle (C:\Users\User\Music\Bot discord\ticket-bot-main\node_modules\discord.js\src\client\actions\InteractionCreate.js:74:12)
at Object.module.exports [as INTERACTION_CREATE] (C:\Users\User\Music\Bot discord\ticket-bot-main\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\User\Music\Bot discord\ticket-bot-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:351:31) {
[Symbol(code)]: 'INVALID_TYPE'
}

Voila si tu pourrait m'aider :)

Change embed according to the chosen category

Good! I want to make it so that when you choose to open a Support ticket, the embed message is different from the embed message when you open a ticket with another name from the MessageSelectMenu. Does anyone know what that code looks like?

that

Change that message depending on the ticket category you open. Thanks!

eng version?

what about y'all make an eng version? i don't understand france very well.

[FIXED][CODE BUG] TRANCIPT EMBED

Him i have a problem where the ticket embed/ticket trancipt doesnt log and send to the user, i tried allot but i dont know how to fix it. im new to coding thats why.

Thank you in advance.

image

Having this error

/home/runner/MemorableAdequateProblem/node_modules/discord.js/src/client/websocket/WebSocketManager.js:250
throw new Error(WSCodes[error.code]);
^

Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted.
at WebSocketManager.createShards (/home/runner/MemorableAdequateProblem/node_modules/discord.js/src/client/websocket/WebSocketManager.js:250:15) {
[Symbol(code)]: 'DISALLOWED_INTENTS'
}
repl process died unexpectedly: exit status 1

Please help me

error

i keep having this error while trying to open a ticket

C:\asd\ticket-bot-main\node_modules\discord.js\src\structures\PermissionOverwrites.js:184
if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
^

TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
at PermissionOverwrites.resolve (C:\asd\ticket-bot-main\node_modules\discord.js\src\structures\PermissionOverwrites.js:184:28)
at C:\asd\ticket-bot-main\node_modules\discord.js\src\managers\GuildChannelManager.js:145:81
at Array.map ()
at GuildChannelManager.create (C:\asd\ticket-bot-main\node_modules\discord.js\src\managers\GuildChannelManager.js:145:51)
at Object.execute (C:\asd\ticket-bot-main\events\interactionCreate.js:15:34)
at Client. (C:\asd\ticket-bot-main\index.js:57:46)
at Client.emit (node:events:549:35)
at InteractionCreateAction.handle (C:\asd\ticket-bot-main\node_modules\discord.js\src\client\actions\InteractionCreate.js:83:12)
at module.exports [as INTERACTION_CREATE] (C:\asd\ticket-bot-main\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\asd\ticket-bot-main\node_modules\discord.js\src\client\websocket\WebSocketManager.js:346:31) {
[Symbol(code)]: 'INVALID_TYPE'
}

problem with tickets

Hello, after configuring the different IDs, when I launch the bot, it correctly sends the message to the lounge, but then it gets into error when I try to create a ticket

PS C:\Okinawa Tickets> node .\index.js
Ticket Bot ready!
Thank you very much for using Ticket Bot! Developed with the ❀️ by Sayrix
(node:3204) DeprecationWarning: Passing strings for MessageEmbed#setAuthor is deprecated. Pass a sole object instead.
(Use node --trace-deprecation ... to show where the warning was created)
(node:3204) DeprecationWarning: Passing strings for MessageEmbed#setFooter is deprecated. Pass a sole object instead.
C:\Okinawa Tickets\node_modules\discord.js\src\rest\RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^

DiscordAPIError: Missing Permissions
at RequestHandler.execute (C:\Okinawa Tickets\node_modules\discord.js\src\rest\RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (C:\Okinawa Tickets\node_modules\discord.js\src\rest\RequestHandler.js:51:14)
at async GuildChannelManager.create (C:\Okinawa Tickets\node_modules\discord.js\src\managers\GuildChannelManager.js:153:18) {
method: 'post',
path: '/guilds/926951246135451739/channels',
code: 50013,
httpStatus: 403,
requestData: {
json: {
name: 'ticket-iWeaPix',
topic: '349691796948910093',
type: 0,
nsfw: undefined,
bitrate: undefined,
user_limit: undefined,
parent_id: '930018774793482260',
position: undefined,
permission_overwrites: [
{ id: '349691796948910093', type: 1, allow: '3072', deny: '0' },
{ id: '928405676940726343', type: 0, allow: '3072', deny: '0' },
{ id: '926951246135451739', type: 0, allow: '0', deny: '1024' }
],
rate_limit_per_user: undefined,
rtc_region: undefined
},
files: []
}
}

Bot issue

I tried to change the things such as token ID and such to match those of the bot I need this on, however the server keeps giving errors upon starting. Can you try to read these and see what the issue is?

Console log:

[WISP] Server marked as STARTING
[WISP] Checking size of server data directory...
[WISP] Disk Usage: 30M / 1028M
[WISP] Ensuring file permissions.
[WISP] Running server preflight.
[WISP] Starting server container.
:/home/container$ if [[ -d .git ]] && [[ 0 == "1" ]]; then git pull; fi; if [[ ! -z ${NODE_PACKAGES} ]]; then /usr/local/bin/npm install ${NODE_PACKAGES}; fi; if [ -f /home/container/package.json ]; then /usr/local/bin/npm install --production; fi; /usr/local/bin/node /home/container/index.js
npm WARN [email protected] license should be a valid SPDX license expression

audited 78 packages in 0.454s
5 packages are looking for funding
run npm fund for details
found 1 moderate severity vulnerability
run npm audit fix to fix them, or npm audit for details
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module 'node:events'
Require stack:

  • /home/container/node_modules/discord.js/src/client/BaseClient.js
  • /home/container/node_modules/discord.js/src/index.js
  • /home/container/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (/home/container/node_modules/discord.js/src/client/BaseClient.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/container/node_modules/discord.js/src/client/BaseClient.js',
    '/home/container/node_modules/discord.js/src/index.js',
    '/home/container/index.js'
    ]
    }
    [WISP] Server marked as OFF
    [WISP] ---------- Detected server process in a crashed state! ----------
    [WISP] Exit code: 1
    [WISP] Out of Memory: false
    [WISP] Error Response:
    [WISP] Server process detected as entering a crashed state; rebooting.

Erreur ready.js

Erreur suivante Γ  rΓ©pΓ©tition donc impossible de lancer le bot :

/home/container/events/ready.js:55
let messages = await channel.messages.fetch(options);
TypeError: Cannot read property 'messages' of undefined
at fetchMore (/home/container/events/ready.js:55:38)
at Object.execute (/home/container/events/ready.js:69:24)
at Client.<anonymous> (/home/container/index.js:57:46)
at Client.emit (node:events:394:28)
at WebSocketManager.triggerClientReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:379:17)
at WebSocketManager.checkShardsReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:362:10)
at WebSocketShard.<anonymous> (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:189:14)
at WebSocketShard.emit (node:events:394:28)
at WebSocketShard.checkReady (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:509:12)
at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:481:16)

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.