mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
Merge branch 'main' of https://github.com/discordeno/discordeno into main
This commit is contained in:
@@ -79,7 +79,7 @@ Here is a minimal example to get started with:
|
||||
import { createBot, startBot } from "https://deno.land/x/discordeno/mod.ts";
|
||||
import { enableCachePlugin, enableCacheSweepers } from "https://deno.land/x/discordeno_cache_plugin@0.0.9/mod.ts";
|
||||
|
||||
const bot = createBot({
|
||||
const baseBot = createBot({
|
||||
token: Deno.env.get("DISCORD_TOKEN"),
|
||||
intents: ["Guilds", "GuildMessages"],
|
||||
botId: Deno.env.get("BOT_ID"),
|
||||
@@ -93,7 +93,9 @@ const bot = createBot({
|
||||
},
|
||||
});
|
||||
|
||||
enableCachePlugin(enableCacheSweepers(bot));
|
||||
const bot = enableCachePlugin(baseBot);
|
||||
|
||||
enableCacheSweepers(bot);
|
||||
|
||||
await startBot(bot);
|
||||
```
|
||||
|
||||
+1
-1
Submodule benchmarks updated: 27a2c5ca04...7944b87a6a
@@ -66,15 +66,16 @@ export async function editInteractionResponse(bot: Bot, token: string, options:
|
||||
custom_id: subcomponent.customId,
|
||||
label: subcomponent.label,
|
||||
style: subcomponent.style,
|
||||
emoji: subcomponent.emoji
|
||||
? {
|
||||
id: subcomponent.emoji.id?.toString(),
|
||||
name: subcomponent.emoji.name,
|
||||
animated: subcomponent.emoji.animated,
|
||||
}
|
||||
: undefined,
|
||||
url: subcomponent.url,
|
||||
disabled: subcomponent.disabled,
|
||||
emoji:
|
||||
"emoji" in subcomponent && subcomponent.emoji
|
||||
? {
|
||||
id: subcomponent.emoji.id?.toString(),
|
||||
name: subcomponent.emoji.name,
|
||||
animated: subcomponent.emoji.animated,
|
||||
}
|
||||
: undefined,
|
||||
url: "url" in subcomponent ? subcomponent.url : undefined,
|
||||
disabled: "disabled" in subcomponent ? subcomponent.disabled : undefined,
|
||||
};
|
||||
}),
|
||||
})),
|
||||
|
||||
@@ -129,15 +129,16 @@ export async function sendInteractionResponse(
|
||||
custom_id: subcomponent.customId,
|
||||
label: subcomponent.label,
|
||||
style: subcomponent.style,
|
||||
emoji: subcomponent.emoji
|
||||
? {
|
||||
id: subcomponent.emoji.id?.toString(),
|
||||
name: subcomponent.emoji.name,
|
||||
animated: subcomponent.emoji.animated,
|
||||
}
|
||||
: undefined,
|
||||
url: subcomponent.url,
|
||||
disabled: subcomponent.disabled,
|
||||
emoji:
|
||||
"emoji" in subcomponent && subcomponent.emoji
|
||||
? {
|
||||
id: subcomponent.emoji.id?.toString(),
|
||||
name: subcomponent.emoji.name,
|
||||
animated: subcomponent.emoji.animated,
|
||||
}
|
||||
: undefined,
|
||||
url: "url" in subcomponent ? subcomponent.url : undefined,
|
||||
disabled: "disabled" in subcomponent ? subcomponent.disabled : undefined,
|
||||
};
|
||||
}),
|
||||
})),
|
||||
|
||||
@@ -127,15 +127,16 @@ export async function editMessage(bot: Bot, channelId: bigint, messageId: bigint
|
||||
custom_id: subcomponent.customId,
|
||||
label: subcomponent.label,
|
||||
style: subcomponent.style,
|
||||
emoji: subcomponent.emoji
|
||||
? {
|
||||
id: subcomponent.emoji.id?.toString(),
|
||||
name: subcomponent.emoji.name,
|
||||
animated: subcomponent.emoji.animated,
|
||||
}
|
||||
: undefined,
|
||||
url: subcomponent.url,
|
||||
disabled: subcomponent.disabled,
|
||||
emoji:
|
||||
"emoji" in subcomponent && subcomponent.emoji
|
||||
? {
|
||||
id: subcomponent.emoji.id?.toString(),
|
||||
name: subcomponent.emoji.name,
|
||||
animated: subcomponent.emoji.animated,
|
||||
}
|
||||
: undefined,
|
||||
url: "url" in subcomponent ? subcomponent.url : undefined,
|
||||
disabled: "disabled" in subcomponent ? subcomponent.disabled : undefined,
|
||||
};
|
||||
}),
|
||||
})),
|
||||
|
||||
@@ -142,15 +142,16 @@ export async function sendMessage(bot: Bot, channelId: bigint, content: string |
|
||||
custom_id: subcomponent.customId,
|
||||
label: subcomponent.label,
|
||||
style: subcomponent.style,
|
||||
emoji: subcomponent.emoji
|
||||
? {
|
||||
id: subcomponent.emoji.id?.toString(),
|
||||
name: subcomponent.emoji.name,
|
||||
animated: subcomponent.emoji.animated,
|
||||
}
|
||||
: undefined,
|
||||
url: subcomponent.url,
|
||||
disabled: subcomponent.disabled,
|
||||
emoji:
|
||||
"emoji" in subcomponent && subcomponent.emoji
|
||||
? {
|
||||
id: subcomponent.emoji.id?.toString(),
|
||||
name: subcomponent.emoji.name,
|
||||
animated: subcomponent.emoji.animated,
|
||||
}
|
||||
: undefined,
|
||||
url: "url" in subcomponent ? subcomponent.url : undefined,
|
||||
disabled: "disabled" in subcomponent ? subcomponent.disabled : undefined,
|
||||
};
|
||||
}),
|
||||
})),
|
||||
|
||||
@@ -3,6 +3,8 @@ import type { EditWebhookMessage } from "../../types/webhooks/editWebhookMessage
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import { AllowedMentionsTypes } from "../../types/messages/allowedMentionsTypes.ts";
|
||||
import { MessageComponentTypes } from "../../types/messages/components/messageComponentTypes.ts";
|
||||
import { hasProperty } from "../../util/utils.ts";
|
||||
import { ButtonComponent } from "../../types/messages/components/buttonComponent.ts";
|
||||
|
||||
export async function editWebhookMessage(
|
||||
bot: Bot,
|
||||
@@ -101,15 +103,16 @@ export async function editWebhookMessage(
|
||||
custom_id: subcomponent.customId,
|
||||
label: subcomponent.label,
|
||||
style: subcomponent.style,
|
||||
emoji: subcomponent.emoji
|
||||
? {
|
||||
id: subcomponent.emoji.id?.toString(),
|
||||
name: subcomponent.emoji.name,
|
||||
animated: subcomponent.emoji.animated,
|
||||
}
|
||||
: undefined,
|
||||
url: subcomponent.url,
|
||||
disabled: subcomponent.disabled,
|
||||
emoji:
|
||||
"emoji" in subcomponent && subcomponent.emoji
|
||||
? {
|
||||
id: subcomponent.emoji.id?.toString(),
|
||||
name: subcomponent.emoji.name,
|
||||
animated: subcomponent.emoji.animated,
|
||||
}
|
||||
: undefined,
|
||||
url: "url" in subcomponent ? subcomponent.url : undefined,
|
||||
disabled: "disabled" in subcomponent ? subcomponent.disabled : undefined,
|
||||
};
|
||||
}),
|
||||
})),
|
||||
|
||||
@@ -81,7 +81,7 @@ export interface DiscordenoComponent {
|
||||
customId?: string;
|
||||
/** whether the component is disabled, default false */
|
||||
disabled?: boolean;
|
||||
/** For different styles/colors of the buttons */
|
||||
/** For different styles/colors of the buttons or TextInput */
|
||||
style?: ButtonStyles | TextStyles;
|
||||
/** text that appears on the button (max 80 characters) */
|
||||
label?: string;
|
||||
|
||||
Reference in New Issue
Block a user