quality fixes

pull/29/head
Matthew 2020-12-25 20:16:41 -05:00
parent ae71b94ad2
commit 7a3ff32122
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
5 changed files with 23 additions and 7 deletions

View File

@ -1,6 +1,6 @@
import { Message, EmbedOptions } from 'eris'; import { Message, EmbedOptions } from 'eris';
import axios, { AxiosResponse, AxiosError } from 'axios'; import axios, { AxiosResponse } from 'axios';
import { Client, Command, RichEmbed } from '../class'; import { Client, Command } from '../class';
export default class Eris extends Command { export default class Eris extends Command {
constructor(client: Client) { constructor(client: Client) {

View File

@ -35,14 +35,14 @@ export default class Game extends Command {
if (!member.activities || member.activities.length <= 0) return this.error(message.channel, 'Cannot find a game for this member.'); if (!member.activities || member.activities.length <= 0) return this.error(message.channel, 'Cannot find a game for this member.');
const embed = new RichEmbed(); const embed = new RichEmbed();
let mainStatus: Activity; let mainStatus: Activity;
if (member.activities[0].type === ActivityType.CUSTOM_STATUS) { if (member.activities[0]?.type === ActivityType.CUSTOM_STATUS) {
mainStatus = member.activities[1]; mainStatus = member.activities[1];
embed.setDescription(`*${member.activities[0].state}*`); embed.setDescription(`*${member.activities[0].state}*`);
} else { } else {
mainStatus = member.activities[0]; mainStatus = member.activities[0];
} }
embed.setAuthor(member.user.username, member.user.avatarURL); embed.setAuthor(member.user.username, member.user.avatarURL);
if (mainStatus.type === ActivityType.LISTENING) { if (mainStatus?.type === ActivityType.LISTENING) {
embed.setTitle('Spotify'); embed.setTitle('Spotify');
embed.setColor('#1ed760'); embed.setColor('#1ed760');
embed.addField('Song', mainStatus.details, true); embed.addField('Song', mainStatus.details, true);

View File

@ -210,7 +210,7 @@ export default class Page extends Command {
priority: 1, priority: 1,
app: 'cr-zero', app: 'cr-zero',
}); });
chan.on('StasisStart', async (event, channel) => { chan.on('StasisStart', async (_event, channel) => {
const playback = await channel.play({ const playback = await channel.play({
media: `sound:/tmp/${fileExtension}`, media: `sound:/tmp/${fileExtension}`,
}, undefined); }, undefined);

View File

@ -27,7 +27,7 @@ export default class Score_Notify extends Command {
await this.client.db.Score.updateOne({ userID: message.author.id }, { $set: { notify: false } }); await this.client.db.Score.updateOne({ userID: message.author.id }, { $set: { notify: false } });
return this.success(message.channel, 'You will no longer be sent notifications when your score is hard-pulled.'); return this.success(message.channel, 'You will no longer be sent notifications when your score is hard-pulled.');
default: default:
return this.error(message.channel, 'Invalid option. Valid options are `yes` and `no`.'); return this.error(message.channel, 'Invalid option. Valid options are `on` and `off`.');
} }
} catch (err) { } catch (err) {
return this.client.util.handleError(err, message, this); return this.client.util.handleError(err, message, this);

View File

@ -21,10 +21,19 @@ interface TLSResponse {
locality: string[], locality: string[],
country: string[], country: string[],
}, },
root: {
commonName: string,
organization: string[],
organizationalUnit: string[],
locality: string[],
country: string[],
},
notBefore: Date,
notAfter: Date,
validationType: 'DV' | 'OV' | 'EV', validationType: 'DV' | 'OV' | 'EV',
signatureAlgorithm: string, signatureAlgorithm: string,
publicKeyAlgorithm: string, publicKeyAlgorithm: string,
serialNumber: number, serialNumber: string,
keyUsage: number[], keyUsage: number[],
keyUsageAsText: ['CRL Signing'?, 'Certificate Signing'?, 'Content Commitment'?, 'Data Encipherment'?, 'Decipher Only'?, 'Digital Signature'?, 'Encipher Only'?, 'Key Agreement'?, 'Key Encipherment'?], keyUsageAsText: ['CRL Signing'?, 'Certificate Signing'?, 'Content Commitment'?, 'Data Encipherment'?, 'Decipher Only'?, 'Digital Signature'?, 'Encipher Only'?, 'Key Agreement'?, 'Key Encipherment'?],
extendedKeyUsage: number[], extendedKeyUsage: number[],
@ -106,10 +115,17 @@ export default class TLS extends Command {
if (resp.issuer.organizationalUnit?.length > 0) issuerString += `**Organizational Unit:** ${resp.issuer.organizationalUnit[0]}\n`; if (resp.issuer.organizationalUnit?.length > 0) issuerString += `**Organizational Unit:** ${resp.issuer.organizationalUnit[0]}\n`;
if (resp.issuer.locality?.length > 0) issuerString += `**Locality:** ${resp.issuer.locality[0]}\n`; if (resp.issuer.locality?.length > 0) issuerString += `**Locality:** ${resp.issuer.locality[0]}\n`;
if (resp.issuer.country?.length > 0) issuerString += `**Country:** ${resp.issuer.country[0]}`; if (resp.issuer.country?.length > 0) issuerString += `**Country:** ${resp.issuer.country[0]}`;
const rootString = `**Root Certificate:** ${resp.root.organization?.length > 0 ? resp.root.organization[0] : ''} (${resp.root.commonName ?? ''} : ${resp.root.organizationalUnit?.length > 0 ? resp.root.organizationalUnit[0] : ''})`;
if (rootString?.length > 0) issuerString += `\n\n${rootString}`;
embed.addField('Issuer', issuerString, true); embed.addField('Issuer', issuerString, true);
embed.addBlankField(); embed.addBlankField();
embed.addField('Issued On', new Date(resp.notBefore).toLocaleString('en-us'), true);
embed.addField('Expiry', new Date(resp.notAfter).toLocaleString('en-us'), true);
embed.addBlankField();
let sanString = ''; let sanString = '';
for (let i = 0; i < resp.san.length; i++) { for (let i = 0; i < resp.san.length; i++) {