fix: minimal template errors

This commit is contained in:
Skillz4Killz
2022-03-25 14:16:47 +00:00
committed by GitHub
parent 0ec7fac393
commit 809c2293a1
4 changed files with 15 additions and 16 deletions
+2 -3
View File
@@ -1,5 +1,4 @@
export * from "https://deno.land/x/discordeno@13.0.0-rc12/mod.ts";
export * from "https://deno.land/x/discordeno_cache_plugin@0.0.14/mod.ts";
export * from "https://deno.land/x/discordeno_fileloader_plugin@v1.0.1/mod.ts";
export * from "https://deno.land/x/discordeno@13.0.0-rc27/mod.ts";
export * from "https://deno.land/x/discordeno@13.0.0-rc27/plugins/mod.ts";
export { config as dotEnvConfig } from "https://deno.land/x/dotenv@v3.1.0/mod.ts";
export * from "https://deno.land/std@0.117.0/fmt/colors.ts";
+2 -2
View File
@@ -3,7 +3,7 @@ import {
ApplicationCommandTypes,
Bot,
Collection,
DiscordenoInteraction,
Interaction,
} from "../../deps.ts";
export type subCommand = Omit<Command, "subcommands">;
@@ -19,7 +19,7 @@ export interface Command {
type: ApplicationCommandTypes;
/** Defaults to `Guild` */
scope?: "Global" | "Guild";
execute: (bot: Bot, interaction: DiscordenoInteraction) => unknown;
execute: (bot: Bot, interaction: Interaction) => unknown;
subcommands?: Array<subCommandGroup | subCommand>;
}
@@ -4,7 +4,7 @@ import {
bgYellow,
black,
BotWithCache,
DiscordenoGuild,
Guild,
green,
red,
white,
@@ -22,7 +22,7 @@ events.interactionCreate = async (rawBot, interaction) => {
if (interaction.data && interaction.id) {
let guildName = "Direct Message";
let guild = {} as DiscordenoGuild;
let guild = {} as Guild;
// Set guild, if there was an error getting the guild, then just say it was a DM. (What else are we going to do?)
if (interaction.guildId) {
+9 -9
View File
@@ -1,8 +1,8 @@
import {
Bot,
BotWithCache,
DiscordenoGuild,
EditGlobalApplicationCommand,
Guild,
CreateApplicationCommand,
getGuild,
MakeRequired,
upsertApplicationCommands,
@@ -18,8 +18,8 @@ export async function updateCommands(
bot: BotWithCache,
scope?: "Guild" | "Global",
) {
const globalCommands: MakeRequired<EditGlobalApplicationCommand, "name">[] = [];
const perGuildCommands: MakeRequired<EditGlobalApplicationCommand, "name">[] = [];
const globalCommands: MakeRequired<CreateApplicationCommand, "name">[] = [];
const perGuildCommands: MakeRequired<CreateApplicationCommand, "name">[] = [];
for (const command of commands.values()) {
if (command.scope) {
@@ -65,8 +65,8 @@ export async function updateCommands(
}
/** Update commands for a guild */
export async function updateGuildCommands(bot: Bot, guild: DiscordenoGuild) {
const perGuildCommands: MakeRequired<EditGlobalApplicationCommand, "name">[] = [];
export async function updateGuildCommands(bot: Bot, guild: Guild) {
const perGuildCommands: MakeRequired<CreateApplicationCommand, "name">[] = [];
for (const command of commands.values()) {
if (command.scope) {
@@ -89,12 +89,12 @@ export async function updateGuildCommands(bot: Bot, guild: DiscordenoGuild) {
export async function getGuildFromId(
bot: BotWithCache,
guildId: bigint,
): Promise<DiscordenoGuild> {
let returnValue: DiscordenoGuild = {} as DiscordenoGuild;
): Promise<Guild> {
let returnValue: Guild = {} as Guild;
if (guildId !== 0n) {
if (bot.guilds.get(guildId)) {
returnValue = bot.guilds.get(guildId) as DiscordenoGuild;
returnValue = bot.guilds.get(guildId) as Guild;
}
await getGuild(bot, guildId).then((guild) => {