diff --git a/.gitignore b/.gitignore index 5f6800b..3f529ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ config.json node_modules debug.log +temp.* \ No newline at end of file diff --git a/structures/client/client.js b/structures/client/client.js index 820628b..abd5e41 100644 --- a/structures/client/client.js +++ b/structures/client/client.js @@ -151,8 +151,11 @@ export class Client extends EventEmitter { /** * @param {String} token + * @param {Boolean} isUser */ async login(token, isUser = false) { + if (!token) throw "PLEASE PROVIDE A TOKEN!"; + if (!isUser) token = "Bot " + token; this.axiosCustom = axios.create({ baseURL: "https://discord.com/api/", diff --git a/structures/guilds/guild.js b/structures/guilds/Guild.js similarity index 100% rename from structures/guilds/guild.js rename to structures/guilds/Guild.js diff --git a/tests/messageTests.js b/tests/messageTests.js index d0f782e..f95ee02 100644 --- a/tests/messageTests.js +++ b/tests/messageTests.js @@ -25,6 +25,6 @@ export default async (message) => { // console.log(messages); } else { // console.log(message); - console.log(`Guild message recieved from "${message.guild.name}"`); + console.log(`Guild message recieved from "${message.guild?.name}"`); } } \ No newline at end of file diff --git a/tests/test.js b/tests/test.js index f8bc2bb..542983d 100644 --- a/tests/test.js +++ b/tests/test.js @@ -3,7 +3,7 @@ import { Client, gateWayIntents, message, Interaction } from '../structures/type import config from '../config.json' assert { type: 'json' }; import { buttonTests } from './Buttontests.js'; import { createMenuTests } from './menuTests.js'; -const { bottoken } = config; +const { token } = config; // switchConsoleDefault(); @@ -24,7 +24,7 @@ var c = new Client({ }); -c.login(bottoken); +c.login(token, true); c.on('messageRecieved', /**@param {message} message*/ async (message) => {