Skip to content

Commit

Permalink
fix some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev committed Aug 29, 2024
1 parent 5aa32ca commit 70764bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/commands/reminders/remindme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const command: Command = {
const reminder = await new Reminder({
reminder_id: id,
user: interaction.user.id,
channel: interaction.channel.id,
channel: interaction.channel.id ? interaction.channel.id : null,
set: Date.now(),
due: Date.now() + time,
delay: time,
Expand All @@ -127,7 +127,7 @@ const command: Command = {
.setTimestamp()


if(sendInChannel) {
if(sendInChannel && interaction.channel.id) {
try {
const channel = client.channels.cache.get(interaction.channel.id) as TextChannel;

Expand Down
4 changes: 2 additions & 2 deletions src/events/client/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const event: Event = {
.setFooter({ text: `ID: ${reminder.reminder_id}` })
.setTimestamp()

if(reminder?.send_in_channel) {
if(reminder?.send_in_channel && reminder?.channel) {
try {
const channel = client.channels.cache.get(reminder.channel) as Discord.TextChannel;

Expand All @@ -71,7 +71,7 @@ const event: Event = {
await user.send({ embeds: [embed] });
} catch {
try {
const channel = client.channels.cache.get(reminder.channel) as Discord.TextChannel;
const channel = client.channels.cache.get(reminder?.channel) as Discord.TextChannel;

if(!channel) return;

Expand Down
4 changes: 2 additions & 2 deletions src/util/setReminder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default async function (reminder: any, client: ExtendedClient): Promise<B
.setFooter({ text: `ID: ${reminder.reminder_id}` })
.setTimestamp()

if(reminder?.send_in_channel) {
if(reminder?.send_in_channel && reminder?.channel) {
try {
const channel = client.channels.cache.get(reminder.channel) as Discord.TextChannel;

Expand All @@ -41,7 +41,7 @@ export default async function (reminder: any, client: ExtendedClient): Promise<B
await user.send({ embeds: [embed] });
} catch {
try {
const channel = client.channels.cache.get(reminder.channel) as Discord.TextChannel;
const channel = client.channels.cache.get(reminder?.channel) as Discord.TextChannel;

if(!channel) return;

Expand Down

0 comments on commit 70764bb

Please sign in to comment.