mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-22 03:25:41 +01:00
tree-wide: code clean-up ...
* remove commented-out code blocks * remove usages of deprecated JS functions
This commit is contained in:
parent
0c3a42e5c7
commit
cbfea20517
@ -70,7 +70,7 @@ export async function command(message: discord.Message) {
|
||||
}
|
||||
}
|
||||
|
||||
const game = message.content.substr(message.content.indexOf(' ') + 1);
|
||||
const game = message.content.substring(message.content.indexOf(' ') + 1);
|
||||
|
||||
// Search all games. This is only linear time, so /shrug?
|
||||
let bestGame: IGameDBEntry | null = null;
|
||||
|
@ -4,7 +4,7 @@ export const roles = ['Admins', 'Moderators'];
|
||||
export async function command (message: discord.Message, reply: string | undefined) {
|
||||
let replyMessage;
|
||||
if (reply == null) {
|
||||
replyMessage = message.content.substr(message.content.indexOf(' ') + 1);
|
||||
replyMessage = message.content.substring(message.content.indexOf(' ') + 1);
|
||||
} else {
|
||||
replyMessage = `${message.mentions.users.map(user => `${user.toString()}`).join(' ')} ${reply}`;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ const repo = process.env.GITHUB_REPOSITORY || 'citra-emu/citra';
|
||||
|
||||
export const roles = ['Admins', 'Moderators', 'Developer'];
|
||||
export async function command(message: discord.Message) {
|
||||
const prNumber = message.content.substr(message.content.indexOf(' ') + 1).replace(/\n/g, '');
|
||||
const prNumber = message.content.substring(message.content.indexOf(' ') + 1).replace(/\n/g, '');
|
||||
const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}`;
|
||||
return fetch(url, fetchOptions).then(response => response.json()).then((pr: any) => {
|
||||
if (!pr || pr.documentation_url || !pr.head) throw new Error('PR not found');
|
||||
|
@ -140,9 +140,7 @@ client.on('messageCreate', async (message) => {
|
||||
if (message.author.bot && message.content.startsWith('.ban') === false) { return; }
|
||||
|
||||
if (message.guild == null && state.responses.pmReply) {
|
||||
// We want to log PM attempts.
|
||||
// logger.info(`${message.author.username} ${message.author} [PM]: ${message.content}`);
|
||||
// state.logChannel.send(`${message.author.toString()} [PM]: ${message.content}`);
|
||||
// We want to reply to PM attempts.
|
||||
await message.reply(state.responses.pmReply);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user