Compare commits

..

No commits in common. "main" and "v0.1.0" have entirely different histories.
main ... v0.1.0

4 changed files with 8 additions and 48 deletions

View file

@ -42,8 +42,7 @@ export async function execute(interaction: ContextMenuCommandInteraction) {
if (!dt.getConfessionById(guildId!, targetId)) {
return interaction.reply({
content:
"Either that confession wasn't found or you aren't allowed to remove it.",
content: "Either that confession wasn't found or you aren't allowed to remove it.",
...messageOpts
});
}

View file

@ -16,7 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { ChatInputCommandInteraction, Events } from "discord.js";
import {
ChatInputCommandInteraction,
Events
} from "discord.js";
import { BotClient, BOT_TOKEN, deployCommands } from "./bot";
import { commands } from "./commands";
import { StoreMan } from "./storeman";
@ -31,8 +34,6 @@ const logger = new Logger("Main");
BotClient.once("ready", client => {
logger.log(`We're ready! Logged in as ${client.user.tag}`);
dt.sendReleaseNotes();
});
// Deploy the commands for a new guild

View file

@ -26,16 +26,8 @@ import {
GuildSettings
} from "./types";
import { DATA_DIR } from "./config";
import {
bold,
CommandInteraction,
heading,
Message,
TextChannel,
unorderedList
} from "discord.js";
import { CommandInteraction, Message } from "discord.js";
import Logger from "../utils/Logger";
import { BotClient } from "../bot";
export class StoreMan {
public static readonly fullPath: string =
@ -111,8 +103,7 @@ export class StoreMan {
this.data.push({
id: guildId,
confessions: [],
settings: opts,
versionNote: "v0.1.1"
settings: opts
});
this.saveFile();
@ -136,33 +127,6 @@ export class StoreMan {
return null;
}
public sendReleaseNotes(): void {
for (const guild of this.data) {
if (!guild.settings.modChannel) {
return;
}
if (guild.versionNote !== "v0.1.1") {
// TODO: Manual release notes for now
const channel = BotClient.channels.cache.get(guild.settings.modChannel);
const content =
heading("🎉 Release v0.1.1\n") +
unorderedList([
"No notable changes with this release, just popping in to say hi! :)",
"You'll get updates about future releases right here in the mod channel!"
]) +
"\n\n" +
bold("Full Changelog: ") +
"https://codeberg.org/powermaker450/confoss/commits/tag/v0.1.1";
(channel as TextChannel).send(content).catch(StoreMan.logger.log);
guild.versionNote = "v0.1.1";
}
}
this.saveFile();
}
// Attempts to add a confession. Returns true if the confession is sent, false if otherwise.
public addConfession(
message: Message,
@ -218,10 +182,7 @@ export class StoreMan {
return null;
}
public getConfessionById(
guildId: string,
messageId: string
): Confession | null {
public getConfessionById(guildId: string, messageId: string): Confession | null {
for (const guild of this.data) {
if (guild.id === guildId) {
for (const confession of guild.confessions) {

View file

@ -44,7 +44,6 @@ export interface GuildSettings {
export interface GuildData {
id: string;
versionNote?: "v0.1.1";
confessions: Confession[];
settings: GuildSettings;
}