1
0
mirror of https://github.com/Burn-E99/SweeperBot.git synced 2026-06-04 07:53:50 -04:00

V0.4.1 - Remove ping command

This commit is contained in:
Ean Milligan (Bastion)
2022-09-09 01:16:46 -04:00
parent 6b2c2b4d51
commit b4e16f6c56
4 changed files with 1 additions and 25 deletions

View File

@@ -1,4 +1,3 @@
import { ping } from './ping.ts';
import { help } from './help.ts';
import { info } from './info.ts';
import { version } from './version.ts';
@@ -7,7 +6,6 @@ import { handleMentions } from './handleMentions.ts';
import { sendMsg } from './sendMessage.ts';
export default {
ping,
help,
info,
version,

View File

@@ -1,17 +0,0 @@
import {
// Discordeno deps
Bot,
Message,
} from '../../deps.ts';
import { generatePing } from '../commandUtils.ts';
import utils from '../utils.ts';
export const ping = async (bot: Bot, message: Message) => {
// Calculates ping between sending a message and editing it, giving a nice round-trip latency.
try {
const m = await bot.helpers.sendMessage(message.channelId, generatePing(-1));
bot.helpers.editMessage(m.channelId, m.id, generatePing(m.timestamp - message.timestamp));
} catch (e) {
utils.commonLoggers.messageSendError('ping.ts:23', message, e);
}
};

View File

@@ -44,11 +44,6 @@ export const messageCreate = async (bot: Bot, message: Message) => {
// All commands below here
switch (command) {
case 'ping':
// s!ping
// Its a ping test, what else do you want.
commands.ping(bot, message);
break;
case 'help':
case 'h':
case '?':