Closed chrischivlog closed 2 years ago
Tatsächlich weiß ich jetzt nicht wo der Fehler her kommt. In der Datei ist kein '?' vorhanden. Sicher das du nicht aus Versehen ein '?' hinzugefügt hast?
Und versuch mal alle modules neu installieren. Also den Ordner node_modules
löschen und npm i
ausführen.
Hab mal in der Config nachgesehen habe an der stelle wo der Token ist auch den Token hin Platziert :D
Allerdings ist mir nicht so klar was bei Color hin soll....
Hier ein ausschnitt aus der Konsole als ich die Module neu installiert habe. Kann es sein das hier neue Versionen verlangt werden?
root@debian:/home/discord-bot# rm -r node_modules/
root@debian:/home/discord-bot# npm i
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@discordjs/builders@0.12.0',
npm WARN EBADENGINE required: { node: '>=16.9.0' },
npm WARN EBADENGINE current: { node: 'v12.22.5', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@discordjs/collection@0.4.0',
npm WARN EBADENGINE required: { node: '>=16.0.0', npm: '>=7.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.5', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@discordjs/rest@0.3.0',
npm WARN EBADENGINE required: { node: '>=16.9.0' },
npm WARN EBADENGINE current: { node: 'v12.22.5', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@sapphire/async-queue@1.2.0',
npm WARN EBADENGINE required: { node: '>=v14.0.0', npm: '>=7.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.5', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@sapphire/snowflake@3.1.0',
npm WARN EBADENGINE required: { node: '>=v14.0.0', npm: '>=7.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.5', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'discord.js@13.6.0',
npm WARN EBADENGINE required: { node: '>=16.6.0', npm: '>=7.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.5', npm: '7.5.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@discordjs/builders@0.11.0',
npm WARN EBADENGINE required: { node: '>=16.0.0', npm: '>=7.0.0' },
npm WARN EBADENGINE current: { node: 'v12.22.5', npm: '7.5.2' }
npm WARN EBADENGINE }
added 115 packages, and audited 116 packages in 3s
15 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
root@debian:/home/discord-bot# npm fund
discord-web-bot-ifheroes@1.0.0
├─┬ https://opencollective.com/eslint
│ │ └── eslint@8.8.0
│ ├── https://github.com/sponsors/epoberezkin
│ │ └── ajv@6.12.6
│ ├─┬ https://github.com/chalk/chalk?sponsor=1
│ │ │ └── chalk@4.1.2
│ │ └── https://github.com/chalk/ansi-styles?sponsor=1
│ │ └── ansi-styles@4.3.0
│ ├── https://github.com/sponsors/sindresorhus
│ │ └── escape-string-regexp@4.0.0, globals@13.12.1, type-fest@0.20.2, import-fresh@3.3.0, strip-json-comments@3.1.1
│ ├── https://github.com/sponsors/mysticatea
│ │ └── eslint-utils@3.0.0, regexpp@3.2.0
│ └── https://github.com/sponsors/isaacs
│ └── rimraf@3.0.2, glob@7.2.0
├── https://github.com/sindresorhus/is?sponsor=1
│ └── @sindresorhus/is@4.4.0
└── https://github.com/sponsors/colinhacks
└── zod@3.11.6
root@debian:/home/discord-bot# ./start.sh
./start.sh: Zeile 3: Syntaxfehler beim unerwarteten Symbol »done«
./start.sh: Zeile 3: `done'
root@debian:/home/discord-bot#
Hat funktioniert allerdings rennt er jetzt in einen neuen Fehler.
Man muss dazu sagen das ich dem Bot auch vorher die Berechtigungen gegeben habe, sollte ich hier noch was ergänzen?
root@debian:/home/discord-bot# npm start
> discord-web-bot-ifheroes@1.0.0 start
> node ./src/index.js
Ready! Logged in as Py-test-bot#4611
Successfully updated Guild Command Permissions!
/home/discord-bot/node_modules/discord.js/src/rest/RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Bots cannot use this endpoint
at RequestHandler.execute (/home/discord-bot/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/discord-bot/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async ApplicationCommandPermissionsManager.set (/home/discord-bot/node_modules/discord.js/src/managers/ApplicationCommandPermissionsManager.js:168:20) {
method: 'put',
path: '/applications/829318719138299934/guilds/876387207458455582/commands/990524906578010122/permissions',
code: 20001,
httpStatus: 403,
requestData: {
json: {
permissions: [ { id: '990280061145985075', permission: true, type: 1 } ]
},
files: []
}
}
root@debian:/home/discord-bot#
Soooo, Problem gefunden, Lösung in Arbeit. Discord hat den API-Endpoint den ich benutzt habe, um den Command nur von einer bestimmten Rolle ausführen zu lassen, deaktiviert und durch etwas anderes ersetzt. Siehe hier.
Weitere Sache, Slash Commands sind nun nicht nur von bestimmten Personen oder Rollen ausführbar (im Sinne von angezeigt werden). Nun gibt es zwei Möglichkeiten:
Bitte um schnelle Antwort.
Würde zweitens bevorzugen da man nicht immer feststeht wer news veröffentlicht. Sorry für die lange Wartezeit
Ich hab vergessen zu erwähnen, dass beim ersten eine Rolle überprüft wird ^^
Also nicht die Person selbst sondern ob er/sie/es (sorry musste sein) die in der Config festgelegte Rolle hat.
Perfekt, ja.
Gut, wäre dann auch gleich fertig. Ich mach dann gleich einen Push und schließe dann auch das Issue :)
Du bisch ein Gott 😍
Sooo: Alles ist online. Bei mir funktioniert alles. Sofern was nicht läuft einfach nochmal ein Issue aufmachen 👍🏻
Habe die Installation durchgeführt gab leider einen Fehler beim Setup
Log vom NPM 2022-06-25T16_07_08_753Z-debug.log