Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

Commit

Permalink
fixed server issues ping.ru
Browse files Browse the repository at this point in the history
  • Loading branch information
vKxni committed May 7, 2021
1 parent 1a3def9 commit 6827491
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 3 deletions.
Binary file modified README.md
Binary file not shown.
3 changes: 3 additions & 0 deletions discord-t/net.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = log; {
console.log("Net loaded")
}
13 changes: 13 additions & 0 deletions discord-t/ping.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'discordrb'

bot = Discordrb::Bot.new token: 'NzkyNjk2NTgyMzk0MDg1Mzk3.X-heOA.d0EK4DK2pvjZlmF26g8_Wa3rQFM'


puts "This bot's invite URL is #{bot.invite_url}."
puts 'Click on it to invite it to your server.'
puts 'Bot owner'

bot.message(content: 'Ping!') do |event|
event.respond 'Pong!'
end

2 changes: 1 addition & 1 deletion ecosystem.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
apps: [
{
name: "Koni's bot",
name: "Util's bot",
script: ".",
//options reference: https://pm2.keymetrics.io/docs/usage/application-declaration/
autorestart: true,
Expand Down
4 changes: 2 additions & 2 deletions src/classes/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class extends Client {
start() {
this.login(this.config.token)
}

// Event Handler
loadEvents() {
const eventFiles = readdirSync(`${__dirname}/../events`).filter(file => file.endsWith('.js'));
for (const file of eventFiles) {
Expand All @@ -41,7 +41,7 @@ export default class extends Client {
}
}
}

// Command Handler
loadCommands() {
readdirSync(`${__dirname}/../commands`)
.filter((f) => f.endsWith(".js"))
Expand Down
24 changes: 24 additions & 0 deletions src/commands/ping.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Client, Command } from "../classes";
import { Message } from "discord.js"

export default class Bot_name extends Command {
constructor(client: Client) {
super({
name: "ping",
description: "ping command"
});
this.client = client;
}

run(msg: Message, args: string[]) {

let client = this.client
let embed = msg.channel.send({
embed: {
color: client.brandingColor,
title: "Ping",
description: `${this.client.ws.ping}MS!`
}
})
}
}

0 comments on commit 6827491

Please sign in to comment.