/[sudobot]/trunk/queues/send-expire.js
ViewVC logotype

Annotation of /trunk/queues/send-expire.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 45 - (hide annotations)
Mon Jul 29 17:28:20 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: text/javascript
File size: 549 byte(s)
Release version 1.8.0

* Added setTimeout() and DB combination support so that the timeouts would never get lost even if the bot stops
* Added messages scheduling, expiring and both in one support
1 rakin 45 const { setTimeoutv2 } = require("../src/setTimeout");
2    
3     async function send(content, channel_id, guild_id, expire_at) {
4     console.log(channel_id, guild_id);
5     const guild = await app.client.guilds.cache.get(guild_id);
6    
7     if (guild) {
8     const channel = await guild.channels.fetch(channel_id);
9    
10     if (channel) {
11     const message = await channel.send({
12     content
13     });
14    
15     await setTimeoutv2('expire.js', expire_at, message.id, channel.id, guild.id);
16     }
17     }
18     }
19    
20     module.exports = send;

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26