Added IRC support (WIP).
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
const config = require('config');
|
||||
|
||||
const style = require('../utils/style');
|
||||
|
||||
const ducks = new Map();
|
||||
let shots = new Map();
|
||||
|
||||
@@ -22,7 +24,7 @@ function launchDuck(context) {
|
||||
const room = rooms[Math.floor(Math.random() * rooms.length)];
|
||||
|
||||
ducks.set(room.id, new Date());
|
||||
context.sendMessage('Quack! :duck:', room.id);
|
||||
context.sendMessage(`Quack! ${config.duck.duck}`, room.id);
|
||||
}, interval);
|
||||
}
|
||||
|
||||
@@ -30,7 +32,7 @@ function onCommand(args, context) {
|
||||
const duck = ducks.get(context.room.id);
|
||||
|
||||
if (!duck) {
|
||||
context.sendMessage(`There is no duck, what are you shooting at, @${context.user.username}?!`, context.room.id);
|
||||
context.sendMessage(`There is no duck, what are you shooting at, ${config.usernamePrefix}${context.user.username}?!`, context.room.id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,7 +41,7 @@ function onCommand(args, context) {
|
||||
|
||||
if (context.command === 'bang') {
|
||||
if (hit) {
|
||||
context.sendMessage(`You shot a duck in **${time} seconds**, @${context.user.username}`, context.room.id);
|
||||
context.sendMessage(`You shot a duck in ${style.bold(`${time} seconds`)}, ${config.usernamePrefix}${context.user.username}`, context.room.id);
|
||||
launchDuck(context);
|
||||
|
||||
context.setPoints(context.user, 1, { key: 'bang' });
|
||||
@@ -48,10 +50,10 @@ function onCommand(args, context) {
|
||||
}
|
||||
|
||||
const messages = [
|
||||
`How could you miss *that*, @${context.user.username}...?!`,
|
||||
`That's a miss! Better luck next time, @${context.user.username}.`,
|
||||
`The duck outsmarted you, @${context.user.username}`,
|
||||
`Channeling Gareth Southgate, @${context.user.username}? You missed!`,
|
||||
`How could you miss *that*, ${config.usernamePrefix}${context.user.username}...?!`,
|
||||
`That's a miss! Better luck next time, ${config.usernamePrefix}${context.user.username}.`,
|
||||
`The duck outsmarted you, ${config.usernamePrefix}${context.user.username}`,
|
||||
`Channeling Gareth Southgate, ${config.usernamePrefix}${context.user.username}? You missed!`,
|
||||
];
|
||||
|
||||
shots.set(context.user.id, new Date());
|
||||
@@ -62,7 +64,7 @@ function onCommand(args, context) {
|
||||
|
||||
if (['bef', 'befriend'].includes(context.command)) {
|
||||
if (hit) {
|
||||
context.sendMessage(`You befriended a duck in **${time} seconds**, @${context.user.username}`, context.room.id);
|
||||
context.sendMessage(`You befriended a duck in ${style.bold(`${time} seconds`)}, ${config.usernamePrefix}${context.user.username}`, context.room.id);
|
||||
launchDuck(context);
|
||||
|
||||
context.setPoints(context.user, 1, { key: 'befriend' });
|
||||
@@ -71,9 +73,9 @@ function onCommand(args, context) {
|
||||
}
|
||||
|
||||
const messages = [
|
||||
`The duck does not want to be your friend right now, @${context.user.username}`,
|
||||
`The duck would like some time for itself, @${context.user.username}`,
|
||||
`The duck isn't in the mood right now, @${context.user.username}`,
|
||||
`The duck does not want to be your friend right now, ${config.usernamePrefix}${context.user.username}`,
|
||||
`The duck would like some time for itself, ${config.usernamePrefix}${context.user.username}`,
|
||||
`The duck isn't in the mood right now, ${config.usernamePrefix}${context.user.username}`,
|
||||
];
|
||||
|
||||
shots.set(context.user.id, new Date());
|
||||
|
||||
Reference in New Issue
Block a user