From 4c63e47285e999b57c2a4b8515908c8d9ba4614b Mon Sep 17 00:00:00 2001 From: pakkographic <41129374+pakkographic@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:39:36 +0200 Subject: [PATCH] Feature Testing script fix --- lib/structures/Client.ts | 1 - scripts/tests/channel.ts | 20 ++++++++++---------- scripts/tests/message.ts | 24 ++++++++++++------------ 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/lib/structures/Client.ts b/lib/structures/Client.ts index e73740e..ae58a87 100644 --- a/lib/structures/Client.ts +++ b/lib/structures/Client.ts @@ -157,7 +157,6 @@ export class Client extends TypedEmitter { return; } - /** Connect to Guilded. */ connect(): void { void this.checkForUpdate(); diff --git a/scripts/tests/channel.ts b/scripts/tests/channel.ts index aedbf2a..30ad650 100644 --- a/scripts/tests/channel.ts +++ b/scripts/tests/channel.ts @@ -3,16 +3,16 @@ const client = new Client({ token: process.env.TOKEN as string }); client.on("ready", async () => { console.log(`Logged as ${client.user?.username}`); - let chat = await client.createChannel("NEa5J8GE", "PIZZANANAS", "chat", { description: "We love Pizza ๐Ÿ•" }); - let announcement = await client.createChannel("NEa5J8GE", "PIZZANANAS", "announcements", { description: "We love Pizza ๐Ÿ•" }); - let calendar = await client.createChannel("NEa5J8GE", "PIZZANANAS", "calendar", { description: "We love Pizza ๐Ÿ•" }); - let forums = await client.createChannel("NEa5J8GE", "PIZZANANAS", "forums", { description: "We love Pizza ๐Ÿ•" }); - let media = await client.createChannel("NEa5J8GE", "PIZZANANAS", "media", { description: "We love Pizza ๐Ÿ•" }); - let voice = await client.createChannel("NEa5J8GE", "PIZZANANAS", "voice", { description: "We love Pizza ๐Ÿ•" }); - let docs = await client.createChannel("NEa5J8GE", "PIZZANANAS", "docs", { description: "We love Pizza ๐Ÿ•" }); - let list = await client.createChannel("NEa5J8GE", "PIZZANANAS", "list", { description: "We love Pizza ๐Ÿ•" }); - let scheduling = await client.createChannel("NEa5J8GE", "PIZZANANAS", "scheduling", { description: "We love Pizza ๐Ÿ•" }); - let stream = await client.createChannel("NEa5J8GE", "PIZZANANAS", "stream", { description: "We love Pizza ๐Ÿ•" }); + let chat = await client.rest.guilds.createChannel("NEa5J8GE", "PIZZANANAS", "chat", { description: "We love Pizza ๐Ÿ•" }); + let announcement = await client.rest.guilds.createChannel("NEa5J8GE", "PIZZANANAS", "announcements", { description: "We love Pizza ๐Ÿ•" }); + let calendar = await client.rest.guilds.createChannel("NEa5J8GE", "PIZZANANAS", "calendar", { description: "We love Pizza ๐Ÿ•" }); + let forums = await client.rest.guilds.createChannel("NEa5J8GE", "PIZZANANAS", "forums", { description: "We love Pizza ๐Ÿ•" }); + let media = await client.rest.guilds.createChannel("NEa5J8GE", "PIZZANANAS", "media", { description: "We love Pizza ๐Ÿ•" }); + let voice = await client.rest.guilds.createChannel("NEa5J8GE", "PIZZANANAS", "voice", { description: "We love Pizza ๐Ÿ•" }); + let docs = await client.rest.guilds.createChannel("NEa5J8GE", "PIZZANANAS", "docs", { description: "We love Pizza ๐Ÿ•" }); + let list = await client.rest.guilds.createChannel("NEa5J8GE", "PIZZANANAS", "list", { description: "We love Pizza ๐Ÿ•" }); + let scheduling = await client.rest.guilds.createChannel("NEa5J8GE", "PIZZANANAS", "scheduling", { description: "We love Pizza ๐Ÿ•" }); + let stream = await client.rest.guilds.createChannel("NEa5J8GE", "PIZZANANAS", "stream", { description: "We love Pizza ๐Ÿ•" }); console.log("๐Ÿ“ง The Channels were created") await chat.edit({ description: "We love Pizza ๐Ÿ•\nWith Nutella", isPublic: true, name:"P-I-Z-Z-A" }); await announcement.edit({ description: "We love Pizza ๐Ÿ•\nWith Nutella", isPublic: true, name:"P-I-Z-Z-A" }); diff --git a/scripts/tests/message.ts b/scripts/tests/message.ts index 406e94f..4635c18 100644 --- a/scripts/tests/message.ts +++ b/scripts/tests/message.ts @@ -4,7 +4,7 @@ const client = new Client({ token: process.env.TOKEN as string}); client.on("ready", async () => { console.log(`Logged as ${client.user?.username}`); console.log("๐Ÿ“ง Sending Message") - let message = await client.createMessage("74a7bc35-21ea-465d-9554-c82ccba067b7", { content: "We love Pizza ๐Ÿ•" }); + let message = await client.rest.channels.createMessage("74a7bc35-21ea-465d-9554-c82ccba067b7", { content: "We love Pizza ๐Ÿ•" }); console.log("๐Ÿ“ง The Message was sent") await message.pin(); console.log("๐Ÿ“Œ The Message was pinned") @@ -31,7 +31,7 @@ client.on("ready", async () => { await message.createReaction(90002552) await message.createReaction(90002583) console.log("๐Ÿ‘ The Reactions were created") - await client.bulkDeleteReactions(message.channelID, "ChannelMessage", message.id) + await client.rest.channels.bulkDeleteReactions(message.channelID, "ChannelMessage", message.id) console.log("๐Ÿ‘ The Reactions were deleted") await message.delete(); console.log("๐Ÿ—‘๏ธ The Message was deleted") @@ -40,9 +40,9 @@ client.on("ready", async () => { if (cache) console.log("โœ… The Message was cached") console.log("--------------------") console.log("๐Ÿ“ง Sending Announcement") - let announcement = await client.createAnnouncement("4a922fbf-f009-4db9-b017-bfff2ac22944", {title: "Pizza",content: "We love Pizza ๐Ÿ•",}); + let announcement = await client.rest.channels.createAnnouncement("4a922fbf-f009-4db9-b017-bfff2ac22944", {title: "Pizza",content: "We love Pizza ๐Ÿ•",}); console.log("๐Ÿ“ง The Announcement was sent") - let comment = await client.createAnnouncementComment(announcement.channelID, announcement.id, {content: "With Pineapple"}); + let comment = await client.rest.channels.createAnnouncementComment(announcement.channelID, announcement.id, {content: "With Pineapple"}); console.log("๐Ÿ“ง The Announcement Comment was sent") await announcement.createReaction(90002573) console.log("๐Ÿ‘ The Reaction was created") @@ -57,7 +57,7 @@ client.on("ready", async () => { console.log("๐Ÿ—‘๏ธ The Announcement was deleted") console.log("--------------------") console.log("๐Ÿ“ง Sending Calendar Event") - let event = await client.createCalendarEvent("76adcbea-ed87-47f2-8225-f6396613eeb4", { + let event = await client.rest.channels.createCalendarEvent("76adcbea-ed87-47f2-8225-f6396613eeb4", { name: "Pizza Party", description: "We love Pizza ๐Ÿ•", color: 0xFFE933, @@ -70,7 +70,7 @@ client.on("ready", async () => { url: "https://www.google.com/search?q=pizza", }); console.log("๐Ÿ“ง The Calendar Event was created") - let Comment = await client.createCalendarComment(event.channelID, event.id, {content: "With Pineapple it's better"}); + let Comment = await client.rest.channels.createCalendarComment(event.channelID, event.id, {content: "With Pineapple it's better"}); console.log("๐Ÿ“ง The Calendar Comment was sent") await Comment.createReaction(90002573) console.log("๐Ÿ‘ The Reaction was created") @@ -96,9 +96,9 @@ client.on("ready", async () => { console.log("๐Ÿ—‘๏ธ The Calendar Event was deleted") console.log("--------------------") console.log("๐Ÿ“ง Sending Docs") - let doc = await client.createDoc("a7bca3fe-d04e-4fc4-9967-cdc53d154d80", {"title":"The 5 Reasons Why You Should Eat Pizza (The 6th Will Shock You)","content":"So, this is the 5 reasons why you should eat pizza:\n1 ยป It's good\n2ยป It's good\n3ยป It's good\n4ยป It's good\n5ยป It's good"}); + let doc = await client.rest.channels.createDoc("a7bca3fe-d04e-4fc4-9967-cdc53d154d80", {"title":"The 5 Reasons Why You Should Eat Pizza (The 6th Will Shock You)","content":"So, this is the 5 reasons why you should eat pizza:\n1 ยป It's good\n2ยป It's good\n3ยป It's good\n4ยป It's good\n5ยป It's good"}); console.log("๐Ÿ“ง The Doc was sent") - let CommentDoc = await client.createDocComment(doc.channelID, doc.id, {content: "With Pineapple it's better"}); + let CommentDoc = await client.rest.channels.createDocComment(doc.channelID, doc.id, {content: "With Pineapple it's better"}); console.log("๐Ÿ“ง The Doc Comment was sent") await CommentDoc.createReaction(90002573) console.log("๐Ÿ‘ The Reaction was created") @@ -113,9 +113,9 @@ client.on("ready", async () => { console.log("๐Ÿ—‘๏ธ The Doc was deleted") console.log("--------------------") console.log("๐Ÿ“ง Sending Forum Topic") - let Thread = await client.createForumThread("478dcf19-fe2f-4fae-b7ee-c54d50ec9bee", {title: "Pizza",content: "We love Pizza ๐Ÿ•",}); + let Thread = await client.rest.channels.createForumThread("478dcf19-fe2f-4fae-b7ee-c54d50ec9bee", {title: "Pizza",content: "We love Pizza ๐Ÿ•",}); console.log("๐Ÿ“ง The Forum Thread was sent") - let CommentThread = await client.createForumComment(Thread.channelID, Thread.id, {content: "With Pineapple it's better"}); + let CommentThread = await client.rest.channels.createForumComment(Thread.channelID, Thread.id, {content: "With Pineapple it's better"}); console.log("๐Ÿ“ง The Forum Comment was sent") await CommentThread.createReaction(90002573) console.log("๐Ÿ‘ The Reaction was created") @@ -130,9 +130,9 @@ client.on("ready", async () => { console.log("๐Ÿ—‘๏ธ The Forum Thread was deleted") console.log("--------------------") console.log("๐Ÿ“ง Sending List Item") - let Item = await client.createListItem("df5a00d1-709e-4b6c-b918-eddfdb1035f5", "Eat some Pizza", {content:"With Pineapple it's better",}); + let Item = await client.rest.channels.createListItem("df5a00d1-709e-4b6c-b918-eddfdb1035f5", "Eat some Pizza", {content:"With Pineapple it's better",}); console.log("๐Ÿ“ง The List Item was sent") - await client.completeListItem(Item.channelID, Item.id); + await client.rest.channels.completeListItem(Item.channelID, Item.id); console.log("๐Ÿ“ง The List Item was completed") await Item.edit({content: "With Nutella" }); console.log("โœ๏ธ The List Item was edited")