Skip to content

Commit

Permalink
Update 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Liaess committed May 1, 2021
1 parent 0187fd4 commit 883f021
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ export default class Events {
this.voice.shuffleCommand(message);
}

@Command('stop')
private stopCommand(message: CommandMessage){
this.voice.stopCommand(message)
}

@Command('loop')
private loopCommand(message: CommandMessage){
this.voice.loopCommand(message)
}


//-------------------------- MESSAGE --------------------------

Expand Down
15 changes: 15 additions & 0 deletions src/events/voice/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import config from 'config';
import { StreamDispatcher, VoiceConnection } from "discord.js";
import { CommandMessage, CommandNotFound, Client } from "@typeit/discord";
import { StreamTransportOptions } from 'winston/lib/winston/transports';
import { monitorEventLoopDelay } from 'node:perf_hooks';
import { repeat } from 'lodash';
const ytdl = require('ytdl-core');

export default class Voice {
Expand Down Expand Up @@ -53,6 +55,13 @@ export default class Voice {
}
}

public stopCommand(message: CommandMessage){
if (!this.whitelist[message.channel.id]) return;
this.player?.dispatcher.end();
this.clearQueueTool();
message.reply(`Parei de tocar? Bota outro som ae :D`)
}

public shuffleCommand(message: CommandMessage){
if (!this.whitelist[message.channel.id]) return;
this.queue = this.shuffle(this.queue);
Expand Down Expand Up @@ -89,6 +98,12 @@ export default class Voice {
// to@do
}

public loopCommand(message: CommandMessage){
if (!this.whitelist[message.channel.id]) return;
//to@do
}


public volumeCommand(message: CommandMessage) {
if (!this.whitelist[message.channel.id]) return;
let bool: any = message.args.value > 100 ? ((message.args.value = 100) / 100) : (message.args.value / 100);
Expand Down

0 comments on commit 883f021

Please sign in to comment.