Skip to content

Commit

Permalink
Add hot or not command, minor alias changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jack5github committed Mar 6, 2023
1 parent 9e8c549 commit 53a133a
Show file tree
Hide file tree
Showing 11 changed files with 572 additions and 12 deletions.
2 changes: 1 addition & 1 deletion commands/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { createCommand, createErrorEmbed, getString } from '../global';
createCommand({
name: 'avatar',
category: 'system',
aliases: ['image', 'pfp', 'pic', 'picture', 'profile'],
aliases: ['icon', 'image', 'pfp', 'pic', 'picture', 'profile'],
description: getString('cmd_avatar'),
longDescription: getString('cmd_avatar_long'),
args: [
Expand Down
2 changes: 1 addition & 1 deletion commands/emojispeak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { createCommand, createErrorEmbed, getString } from '../global';
createCommand({
name: 'emojispeak',
category: 'chat',
aliases: ['emoji', 'say', 'speak', 'super', 'superhot'],
aliases: ['say', 'speak', 'super', 'superhot'],
description: getString('cmd_emojispeak'),
longDescription: getString('cmd_emojispeak_long'),
args: [
Expand Down
9 changes: 7 additions & 2 deletions commands/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async function helpCommand(
}
let title = '`' + command.name + '`';
if (command.featured) {
title = title + ' ⭐';
title = title + ' ' + getString('help_featured_icon');
}
fields.push({
name: title,
Expand All @@ -154,7 +154,12 @@ async function helpCommand(
// A matching command was found, display all information about it.
let title = '`' + command.name + '`';
if (command.featured) {
title = title + ' ⭐ *Featured!*';
title =
title +
' ' +
getString('help_featured_icon') +
' ' +
getString('help_featured');
}
embed.setTitle(title);
let description = '';
Expand Down
532 changes: 532 additions & 0 deletions commands/hotornot.ts

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions commands/jazz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ async function showJazzLeaderboard(
if (users != null && users.length >= 1) {
// Determine the number of pages and what page to display
let currentPage = 1;
console.log(input);
if (input.length >= 2) {
currentPage = parseInt(input[1]);
}
Expand Down Expand Up @@ -581,7 +580,7 @@ async function jazzIsUserTimedOut(message: discord.GuildMemberMessage) {
resolve(0);
}
})
.catch((err) => {
.catch(() => {
// There was an error with the database, do not allow the user to continue.
resolve(-1);
});
Expand Down
3 changes: 1 addition & 2 deletions commands/standoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ async function standoffCommand(
embed.setDescription(
getString('standoff_fire_desc')
);
oldMessage.delete();
message.reply(embed);
oldMessage.edit(embed);
})
.catch(() => {
createErrorEmbed(
Expand Down
1 change: 1 addition & 0 deletions commands/support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ createCommand({
'developer',
'dev',
'jack5',
'rate',
'report',
'rep',
'suggestion',
Expand Down
9 changes: 6 additions & 3 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ export const ECONOMY_DAILY_MAXIMUM = 99;

// Hangman command settings.
export const HANGMAN_CHANCES = 7; // How many chances users get to guess a word.
export const HANGMAN_TIMEOUT = 60 * 60 * 1000; // How long until a user's game is deleted automatically in milliseconds.
export const HANGMAN_TIMEOUT = 60 * 60000; // How long until a user's game is cancelled automatically in milliseconds.

// Hot or Not command settings.
export const HOTORNOT_TIMEOUT = 60000; // How long until a voting window is cancelled automatically in milliseconds.

// Jazztronauts command settings.
export const JAZZ_PILLAGE_COOLDOWN = 5 * 60 * 1000; // How long users must wait between pillaging objects in milliseconds.
export const JAZZ_PILLAGE_COOLDOWN = 5 * 60000; // How long users must wait between pillaging objects in milliseconds.
export const JAZZ_OBJECTS_MINIMUM = 16; // The minimum number of objects that can spawn at once.
export const JAZZ_OBJECTS_MAXIMUM = 30; // The maximum number of objects that can spawn at once.
export const JAZZ_OUTSIDE_CHANCE = 0.5; // How often outside objects will appear out of 1.
Expand All @@ -118,7 +121,7 @@ export const JAZZ_REWARD_BONUS_MULTIPLIER = 2; // How much to multiply the point
// Standoff command settings.
export const STANDOFF_WAIT_MINIMUM = 4000; // The minimum amount of time before users can fire at each-other in milliseconds, should be more than command cooldown.
export const STANDOFF_WAIT_MAXIMUM = 10000; // The maximum amount of time before users can fire at each-other in milliseconds.
export const STANDOFF_TIMEOUT = 60 * 1000; // How long until a challenge is deleted automatically in milliseconds.
export const STANDOFF_TIMEOUT = 60000; // How long until a challenge is cancelled automatically in milliseconds.

// Steam Game default steamid64 - What steamid64 to use when none is provided. Get one from https://steamid.io
export const STEAMGAME_DEFAULT_STEAMID64 = '';
Expand Down
18 changes: 18 additions & 0 deletions lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export const dictionary: any = {
"⚠️ *This command can only be run in the bot's dedicated channels.*",
help_no_cmds_in_category:
'No commands could be found in that category. Please contact a server manager.',
help_featured_icon: '⭐',
help_featured: '*Featured!*',
cmd_eightball: 'Get your fortune told from The Magic 8-Ball.',
cmd_eightball_long:
"Got a question that you want a second opinion on? Get your or someone else's fortune told from The Magic 8-Ball.",
Expand Down Expand Up @@ -120,6 +122,11 @@ export const dictionary: any = {
cmd_help_long:
"With this command you can preview every other command and access info about them. But you already knew that, didn't you?",
cmd_help_arg_topic: 'The command or category to learn more about.',
cmd_hotornot: 'Settle once and for all the best emojis around!',
cmd_hotornot_long:
"Take part in a survey where you're shown a pair of emoji and asked which is better. Vote more for a bigger impact!",
cmd_hotornot_arg_lb:
'Opens the leaderboard of the best emojis as cumulatively voted by everyone.',
cmd_hug: 'Reply to a message to give that user a hug!',
cmd_hug_long:
'Sometimes you need to show your appreciation to another user. With this command you can give them a hug by replying to them!',
Expand Down Expand Up @@ -286,6 +293,17 @@ export const dictionary: any = {
'There was an error checking the state of your game. Please try again later.',
hangman_api_error:
'There was an error fetching a word from the API, please try again later or contact a manager.',
hotornot_start_emojis: '%1 🆚 %2',
hotornot_start: 'Hot or Not! Which of these emoji is the best?',
hotornot_voted: '%1 Your vote has been submitted!',
hotornot_voted_incompatible: 'Your vote has been submitted!',
hotornot_lb_title: 'Hot or Not Leaderboard',
hotornot_lb_row: '**%1%2:** %3 `%4` - (%5)',
hotornot_lacking_emojis:
'There are not enough emoji on this Discord server for this command to run, please contact a manager.',
hotornot_lb_no_users: 'No-one has voted for any emoji yet.',
hotornot_db_error:
'There was an error accessing the emoji scores. Please try again later.',
hug_no_or_self_reply:
"You need to reply to someone else's message to hug them.",
hug_other_user: [
Expand Down
1 change: 1 addition & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import './commands/emojispeak';
import './commands/flip';
import './commands/hangman';
import './commands/help';
import './commands/hotornot';
import './commands/hug';
import './commands/jazz';
import './commands/links';
Expand Down
4 changes: 3 additions & 1 deletion scheduled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
*/

import { deleteExpiredHangmans } from './commands/hangman';
import { deleteExpiredHotOrNots } from './commands/hotornot';
import { spawnJazzObjects, showJazzObjects } from './commands/jazz';
import { deleteExpiredStandoffs } from './commands/standoff';
import { tvShowRandomVideo } from './commands/tv';

// Run every hour
pylon.tasks.cron('delete_expired_games', '0 0 * * * *', async () => {
pylon.tasks.cron('delete_expired_embeds', '0 0 * * * *', async () => {
deleteExpiredHangmans();
deleteExpiredHotOrNots();
deleteExpiredStandoffs();
});

Expand Down

0 comments on commit 53a133a

Please sign in to comment.