Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #128 from ClarityMoe/development
Browse files Browse the repository at this point in the history
0.4.1
  • Loading branch information
sr229 authored Dec 22, 2017
2 parents 2e4c5f5 + b3131b8 commit 88eb473
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clara",
"version": "0.4.0",
"version": "0.4.1",
"description": "A general-purpose discord bot.",
"main": "src/bot.js",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"bot"
],
"author": "ClarityMoe",
"license": "BSD",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/ClarityMoe/Clara/issues"
},
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/main/music/music.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ exports.join = {
if (bot.music.connections.get(ctx.guild.id)) return await ctx.createMessage('music-botInChannel');
if (!ctx.member.voiceState.channelID) return await ctx.createMessage('music-userNotInChannel');

let conn = await bot.joinVoicechannel(ctx.member.voiceState.channelID);
let conn = await bot.joinVoiceChannel(ctx.member.voiceState.channelID);

bot.music.inactives.push([bot.guilds.get(conn.id).channels.get(conn.channelID), Date.now()]);
bot.music.connections.get(ctx.guild.id).summoner = ctx.member;
Expand Down
42 changes: 41 additions & 1 deletion src/cmd/misc/marry/marry.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

exports.commands = [
'marry',
'divorce'
'divorce',
'marrycheck'
];

exports.marry = {
Expand All @@ -21,6 +22,12 @@ exports.marry = {
if (!user) return;
if (user.id === ctx.author.id) return await ctx.createMessage('marry-noSelfcest');
if (user.id === bot.user.id) return await ctx.createMessage('marry-selfMentioned');
if (await bot.db.has(user.id) && await bot.db[user.id].partner.get) {
return await ctx.createMessage('marry-partnerIsMarried', null, 'channel', {
author: ctx.author.mention,
partner: utils.formatUsername(user)
});
}

await ctx.createMessage('marry-prompt', null, 'channel', {
author: ctx.author.mention,
Expand Down Expand Up @@ -113,4 +120,37 @@ exports.divorce = {
});

}
};

exports.marrycheck = {
desc: "Checks your, or someone else's, partner.",
usage: '[user]',
async main(bot, ctx) {
if (ctx.suffix) {
let user = await bot.lookups.memberLookup(ctx, ctx.suffix);

if (!user) return;

if (await bot.db.has(user.id) && await bot.db[user.id].partner.get) {
let partner = bot.users.get(await bot.db[user.id].partner.get);

return await ctx.createMessage('marrycheck-otherUser-hasPartner', null, 'channel', {
user: utils.formatUsername(user),
partner: utils.formatUsername(partner)
});
} else {
return await ctx.createMessage('marrycheck-otherUser-noPartner', null, 'channel', {
user: utils.formatUsername(user)
});
}
}

if (ctx.settings.user.partner) {
let partner = bot.users.get(ctx.settings.user.partner);

return await ctx.createMessage('marrycheck-hasPartner', null, 'channel', {
partner: utils.formatUsername(partner)
});
} else return await ctx.createMessage('marrycheck-noPartner');
}
};
2 changes: 1 addition & 1 deletion src/cmd/misc/ship/ship.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports.ship = {
desc: 'Ship people.',
usage: '<2 names or mentions>',
async main(bot, ctx) {
if (ctx.mentions.length > 2 || ctx.args.length > 2) return await ctx.createMessage('ship-noArgs');
if (ctx.args.length !== 2) return await ctx.createMessage('ship-noArgs');

let a = !ctx.mentions[0] ? ctx.args[0] : ctx.mentions[0].username;
let b = !ctx.mentions[1] ? ctx.args[1] : ctx.mentions[1].username;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Clara.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Clara extends Eris.Client {
this.lookups = new Lookups(this);
this.localeManager = new LocaleManager();
this.commands = new CommandHolder(this);
this.db = new Redite({url: config.redisURL || 'redis://127.0.0.1/0'});
this.db = new Redite({url: config.redisURL || config.redisUrl || 'redis://127.0.0.1/0'});

this.loadCommands = true;
this.allowCommandUse = false;
Expand Down

0 comments on commit 88eb473

Please sign in to comment.