mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 08:20:58 -05:00
Compare commits
2 Commits
6c52ff1f86
...
0dc69816db
Author | SHA1 | Date | |
---|---|---|---|
|
0dc69816db | ||
|
2d2db8f4eb |
@ -17,7 +17,7 @@ export default {
|
|||||||
async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
|
async run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>){
|
||||||
if (client.uptime < 35000) return interaction.reply('I have just restarted, please wait for MPLoop to finish initializing.')
|
if (client.uptime < 35000) return interaction.reply('I have just restarted, please wait for MPLoop to finish initializing.')
|
||||||
const serverSelector = interaction.options.getString('server');
|
const serverSelector = interaction.options.getString('server');
|
||||||
if (interaction.channelId === '468835769092669461' && !client.isStaff(interaction.member) && ['status', 'players'].includes(interaction.options.getSubcommand())) return interaction.reply('Please use <#739084625862852715> for `/mp status/players` commands to prevent clutter in this channel.').then(()=>setTimeout(()=>interaction.deleteReply(), 6000));
|
if (['468835769092669461', '1149238561934151690'].includes(interaction.channelId) && !client.isStaff(interaction.member) && ['status', 'players'].includes(interaction.options.getSubcommand())) return interaction.reply('Please use <#739084625862852715> for `/mp status/players` commands to prevent clutter in this channel.').then(()=>setTimeout(()=>interaction.deleteReply(), 6000));
|
||||||
|
|
||||||
const database = await client.MPServer._content.findById(interaction.guildId);
|
const database = await client.MPServer._content.findById(interaction.guildId);
|
||||||
const endpoint = await fetch(database[serverSelector].ip+'/feed/dedicated-server-stats.json?code='+database[serverSelector].code, {signal: AbortSignal.timeout(7500),headers:{'User-Agent':'Daggerbot - MPdata/undici'}}).then(r=>r.json() as Promise<FSData>);
|
const endpoint = await fetch(database[serverSelector].ip+'/feed/dedicated-server-stats.json?code='+database[serverSelector].code, {signal: AbortSignal.timeout(7500),headers:{'User-Agent':'Daggerbot - MPdata/undici'}}).then(r=>r.json() as Promise<FSData>);
|
||||||
@ -227,7 +227,7 @@ export default {
|
|||||||
.setName('server')
|
.setName('server')
|
||||||
.setDescription('The server to update')
|
.setDescription('The server to update')
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
.setChoices(serverChoices[0])))
|
.setChoices(serverChoices[0], serverChoices[1])))
|
||||||
.addSubcommand(x=>x
|
.addSubcommand(x=>x
|
||||||
.setName('players')
|
.setName('players')
|
||||||
.setDescription('Display players on server')
|
.setDescription('Display players on server')
|
||||||
@ -235,7 +235,7 @@ export default {
|
|||||||
.setName('server')
|
.setName('server')
|
||||||
.setDescription('The server to display players for')
|
.setDescription('The server to display players for')
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
.setChoices(serverChoices[0])))
|
.setChoices(serverChoices[0], serverChoices[1])))
|
||||||
.addSubcommand(x=>x
|
.addSubcommand(x=>x
|
||||||
.setName('url')
|
.setName('url')
|
||||||
.setDescription('View or update the server URL')
|
.setDescription('View or update the server URL')
|
||||||
@ -255,5 +255,5 @@ export default {
|
|||||||
.setName('server')
|
.setName('server')
|
||||||
.setDescription('The server to display information for')
|
.setDescription('The server to display information for')
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
.setChoices(serverChoices[0])))
|
.setChoices(serverChoices[0], serverChoices[1])))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user