Browse Source

fix: show introductory message to new users

development
Abheek Dhawan 2 years ago
parent
commit
0b92256761
Signed by: abheekd GPG Key ID: 7BE81B8C14475B67
  1. 24
      src/commands/train.ts

24
src/commands/train.ts

@ -42,6 +42,14 @@ export async function execute(interaction : CommandInteraction) {
.then((obj: { score: number; }, err: unknown) => { .then((obj: { score: number; }, err: unknown) => {
if (!obj) { if (!obj) {
score = 0; score = 0;
const firstTimeEmbed = new MessageEmbed()
.setAuthor({ name: interaction.client.user?.tag ? interaction.client.user?.tag : '', iconURL: interaction.client.user?.displayAvatarURL() })
.setDescription('Hey! It seems like it\'s your first time using AwesomeSciBo. Here\'s some information regarding the bot if you need it (for issues, contributions, etc.):')
.addField('Creator', '<@745063586422063214> [@abheekd#3602]')
.addField('GitHub', '[Link](https://github.com/ADawesomeguy/AwesomeSciBo) (a star couldn\'t hurt...)')
.setColor('#ffffff')
.setTimestamp();
interaction.user.send({ embeds: [firstTimeEmbed] });
} }
else if (obj) { else if (obj) {
score = obj.score; score = obj.score;
@ -128,22 +136,6 @@ export async function execute(interaction : CommandInteraction) {
if (answerMsg?.author.id === interaction.client.user?.id) return; if (answerMsg?.author.id === interaction.client.user?.id) return;
const doc = userScore.findOne({
authorID: authorId,
});
if (!doc) {
const firstTimeEmbed = new MessageEmbed()
.setAuthor({ name: interaction.client.user?.tag ? interaction.client.user?.tag : '', iconURL: interaction.client.user?.displayAvatarURL() })
.setDescription('Hey! It seems like it\'s your first time using AwesomeSciBo. Here\'s some information regarding the bot if you need it (for issues, contributions, etc.):')
.addField('Creator', '<@745063586422063214> [@abheekd#3602]')
.addField('GitHub', '[Link](https://github.com/ADawesomeguy/AwesomeSciBo) (a star couldn\'t hurt...)')
.setColor('#ffffff')
.setTimestamp();
answerMsg?.author.send({ embeds: [firstTimeEmbed] });
}
let predicted = ''; let predicted = '';
if (answerMsg?.content.toLowerCase() === tossupAnswer.toLowerCase() || answers.includes(answerMsg?.content.toUpperCase())) { if (answerMsg?.content.toLowerCase() === tossupAnswer.toLowerCase() || answers.includes(answerMsg?.content.toUpperCase())) {
predicted = 'correct'; predicted = 'correct';

Loading…
Cancel
Save