Initial commit
This commit is contained in:
20
wwwroot/core/base/MessageSender.js
Normal file
20
wwwroot/core/base/MessageSender.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import {data} from "../appData.js";
|
||||
|
||||
export class MessageSender {
|
||||
|
||||
constructor(client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
async send(channelID, message) {
|
||||
|
||||
const channel = await data.client.channels.fetch(channelID);
|
||||
|
||||
if (channel && channel.isTextBased()) {
|
||||
await channel.send(message);
|
||||
} else {
|
||||
console.log('❌ Channel not found!');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user