Skip to content

Commit

Permalink
fix: hotfix round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
lleyton committed Nov 13, 2024
1 parent 6f72151 commit 6c6cdf8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raboneko",
"version": "0.21.1",
"version": "0.21.2",
"description": "Raboneko.",
"main": "dist/index.js",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/commands/remind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const handleReminderEvent = async (reminderID: number): Promise<void> =>
.setEmoji('🛌'),
);

const channel = (await raboneko.channels.cache.get(reminder.channelID)!.fetch()) as TextChannel;
const channel = (await raboneko.channels.fetch(reminder.channelID)) as TextChannel;
const message = await channel.send({
content: `Gmeow <@${reminder.userID}>! Just wanted to remind you to \`${reminder.content}\`, nya~ Don't forget to take care of it, okie? :3`,
components: [buttonRow],
Expand Down
12 changes: 7 additions & 5 deletions src/modules/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getLoggingChannel, userURL } from '../util';
// - GuildMemberRemove

client.on(Events.MessageDelete, async (message) => {
if (!message.member) return;
if (!message.member || message.author?.bot) return;

const loggingChannel = await getLoggingChannel();
if (!loggingChannel.isSendable()) {
Expand All @@ -24,7 +24,7 @@ client.on(Events.MessageDelete, async (message) => {
url: userURL(message.member.user.id),
})
.setColor('#ff0000')
.setDescription(message.content)
.setDescription(message.content && message.content.length !== 0 ? message.content : 'Unknown')
.setFooter({
text: `Message ID: ${message.id} | User ID: ${message.member.user.id}`,
}).data;
Expand All @@ -35,7 +35,7 @@ client.on(Events.MessageDelete, async (message) => {
});

client.on(Events.MessageUpdate, async (oldMessage, newMessage) => {
if (!oldMessage.member) return;
if (!oldMessage.member || oldMessage.author?.bot || newMessage.author?.bot) return;

const loggingChannel = await getLoggingChannel();
if (!loggingChannel.isSendable()) {
Expand All @@ -53,11 +53,13 @@ client.on(Events.MessageUpdate, async (oldMessage, newMessage) => {
.addFields(
{
name: 'Old Content',
value: oldMessage.content ?? 'Unknown',
value:
oldMessage.content && oldMessage.content?.length !== 0 ? oldMessage.content : 'Unknown',
},
{
name: 'New Content',
value: newMessage.content ?? 'Unknown',
value:
newMessage.content && newMessage.content.length !== 0 ? newMessage.content : 'Unknown',
},
)
.setFooter({
Expand Down

0 comments on commit 6c6cdf8

Please sign in to comment.