Skip to content

Commit

Permalink
v1.1.0 (#508)
Browse files Browse the repository at this point in the history
* ci: 💚 remove arm64 build (#497) (#498)

I had to remove arm64 platform from the images since prisma client do not seem to support arm64 yet

* User Experience Improvements (#507)

* ci: 💚 remove arm64 build (#497)

I had to remove arm64 platform from the images since prisma client do not seem to support arm64 yet

* Update dependency prettier to v2.8.0 (#502)

* fix: 📦 add missing package prisma

* ci: 💚 remove arm64 build (#497) (#498) (#499)

I had to remove arm64 platform from the images since prisma client do not seem to support arm64 yet

* Update Dockerfile

* Update schema.prisma

* Configure Renovate (#500)

* Add renovate.json

* Format code with prettier

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>

* Update dependency prettier to v2.8.0

Co-authored-by: Vermium Sifell <vermium@zyner.org>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>

* Update dependency @types/uuid to v9 (#503)

* fix: 📦 add missing package prisma

* ci: 💚 remove arm64 build (#497) (#498) (#499)

I had to remove arm64 platform from the images since prisma client do not seem to support arm64 yet

* Update Dockerfile

* Update schema.prisma

* Configure Renovate (#500)

* Add renovate.json

* Format code with prettier

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>

* Fix invite URL (#504)

* Update dependency @types/uuid to v9

Co-authored-by: Vermium Sifell <vermium@zyner.org>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Kreusada <67752638+Kreusada@users.noreply.github.com>

* Update dependency lint-staged to v13.0.4 (#501)

* fix: 📦 add missing package prisma

* ci: 💚 remove arm64 build (#497) (#498) (#499)

I had to remove arm64 platform from the images since prisma client do not seem to support arm64 yet

* Update Dockerfile

* Update schema.prisma

* Configure Renovate (#500)

* Add renovate.json

* Format code with prettier

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>

* Fix invite URL (#504)

* Update dependency lint-staged to v13.0.4

Co-authored-by: Vermium Sifell <vermium@zyner.org>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Kreusada <67752638+Kreusada@users.noreply.github.com>

* It's all about User Experience (#505)

* chore(ux): 🚸 Improved credits balance messages

Improved how messages is written by using "you" form and make it less cluttered

* feat(ux): 🚸 Added version to utility stats

Added a running version field to utility stats to show hosters and their users if they support commands that may is too new for their running version

* chore(nodejs): 🔖 change version to v1.1.0

This is to make sure that package.json has corrcet version tagged inside of it

* chore(ux): 🚸 updated "on cooldown" message

Makes more sense to talk in a more positive tone than a negative tone

* style(ux): 🚚 utility => utils

Renaming utility category to utils makes it easier for users to retype commands

* chore(ux): 🚸 Improved utils about

"/utils about" now shows information about the current bot instance, such as uptime, total users and guilds and version

Removed information about Xyter in the bot. Instead users are expected to go to out documentation to learn more

* chore(ux): 🚸 Improved /utils avatar

Improved messages for /utils avatar and added a link for people to know that they could download the image

* refactor(ux): 🚸 Removed /utils ping

Removed /utils ping since /utils about now includes latency related information

Merged /utils ping into /utils about

* refactor(ux): 🚸 Removed /utils stats

Removed /utils stats since now /utils about includes information about bot instance

Merged /utils stats into /utils about

* chore(ux): 🚸 Improved /fun meme

Improved UX for /fun meme and added a link button for viewing the post

* chore(ux): 🚸 /reputation view => /reputation check and improved UX

Renamed /reputation view to /reputation check as it makes more sense, also improved messages for better user experience

Moved /reputation view to /reputation check

* chore(ux): 🚸 Moved /reputation give => /reputation repute and improved UX

/reputation repute makes more sense than /reputation give and I also updated messages to be more user engaging

Moved /reputation give to /reputation repute

* chore(ux): 🚸 Improved error messages

I changed so description would be the error message instead of the error object. I also updated the title and added a report problem button that links to the official discord server

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Kreusada <67752638+Kreusada@users.noreply.github.com>

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Kreusada <67752638+Kreusada@users.noreply.github.com>
  • Loading branch information
4 people authored Dec 4, 2022
1 parent 461d254 commit 7b34763
Show file tree
Hide file tree
Showing 16 changed files with 291 additions and 337 deletions.
96 changes: 48 additions & 48 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xyter",
"version": "3.1.0",
"version": "v1.1.0",
"description": "Earn credits while chatting! And more",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -49,17 +49,17 @@
"devDependencies": {
"@types/chance": "1.1.3",
"@types/node-schedule": "2.1.0",
"@types/uuid": "8.3.4",
"@types/uuid": "9.0.0",
"@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0",
"eslint": "^8.26.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-no-loops": "0.3.0",
"eslint-plugin-prettier": "4.2.1",
"lint-staged": "13.0.3",
"lint-staged": "13.0.4",
"nodemon": "2.0.20",
"prettier": "2.7.1",
"prettier": "2.8.0",
"prisma": "^4.5.0",
"semantic-release": "^19.0.5"
},
Expand Down
19 changes: 8 additions & 11 deletions src/commands/credits/modules/balance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import logger from "../../../../middlewares/logger";
export const builder = (command: SlashCommandSubcommandBuilder) => {
return command
.setName("balance")
.setDescription(`View a user's balance`)
.setDescription(`Check balance`)
.addUserOption((option) =>
option
.setName("target")
.setDescription(`The user whose balance you want to view`)
option.setName("target").setDescription(`Account you want to check`)
);
};

Expand All @@ -24,15 +22,15 @@ export const execute = async (interaction: CommandInteraction) => {

// 2. Destructure interaction object.
const { options, user, guild } = interaction;
if (!guild) throw new Error("Guild not found");
if (!user) throw new Error("User not found");
if (!options) throw new Error("Options not found");
if (!guild) throw new Error("Server unavailable");
if (!user) throw new Error("User unavailable");
if (!options) throw new Error("Options unavailable");

// 3. Get options from interaction.
const target = options.getUser("target");

// 4. Create base embeds.
const EmbedSuccess = await BaseEmbedSuccess(guild, "[:dollar:] Balance");
const EmbedSuccess = await BaseEmbedSuccess(guild, ":credit_card:︱Balance");

// 5. Upsert the user in the database.
const createGuildMember = await prisma.guildMember.upsert({
Expand Down Expand Up @@ -71,15 +69,14 @@ export const execute = async (interaction: CommandInteraction) => {
},
});
logger.silly(createGuildMember);
if (!createGuildMember) throw new Error("No guild member exists.");

// 6. Send embed.
await interaction.editReply({
embeds: [
EmbedSuccess.setDescription(
target
? `${target} has ${createGuildMember.creditsEarned} credits.`
: `You have ${createGuildMember.creditsEarned} credits.`
? `${target} has ${createGuildMember.creditsEarned} coins in his account.`
: `You have ${createGuildMember.creditsEarned} coins in your account.`
),
],
});
Expand Down
43 changes: 18 additions & 25 deletions src/commands/fun/modules/meme/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import axios from "axios";
import {
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
CommandInteraction,
EmbedBuilder,
SlashCommandSubcommandBuilder,
Expand All @@ -10,15 +13,15 @@ import cooldown from "../../../../middlewares/cooldown";

export default {
builder: (command: SlashCommandSubcommandBuilder) => {
return command.setName("meme").setDescription("Get a meme from r/memes)");
return command.setName("meme").setDescription("Random memes from r/memes");
},

execute: async (interaction: CommandInteraction) => {
await deferReply(interaction, false);

const { guild, user, commandId } = interaction;
if (!guild) throw new Error("Guild not found");
if (!user) throw new Error("User not found");
if (!guild) throw new Error("Server unavailable");
if (!user) throw new Error("User unavailable");

await cooldown(guild, user, commandId, 15);

Expand All @@ -30,35 +33,25 @@ export default {
const response = res.data[0].data.children;
const content = response[0].data;

const buttons = new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setLabel("View post")
.setStyle(ButtonStyle.Link)
.setEmoji("🔗")
.setURL(`https://reddit.com${content.permalink}`)
);

const embed = new EmbedBuilder()
.setAuthor({
name: content.title,
iconURL:
"https://www.redditinc.com/assets/images/site/reddit-logo.png",
url: `https://reddit.com${content.permalink}`,
})
.setTitle("[:sweat_smile:] Meme")
.addFields([
{
name: "Author",
value: `[${content.author}](https://reddit.com/user/${content.author})`,
inline: true,
},
{
name: "Votes",
value: `${content.ups}/${content.downs}`,
inline: true,
},
])
.setTitle(`😆︱Meme`)
.setDescription(`**${content.title}**`)
.setTimestamp(new Date())
.setImage(content.url)
.setFooter({
text: embedConfig.footerText,
iconURL: embedConfig.footerIcon,
text: `👍 ${content.ups}︱👎 ${content.downs}`,
})
.setColor(embedConfig.successColor);

await interaction.editReply({ embeds: [embed] });
await interaction.editReply({ embeds: [embed], components: [buttons] });
return;
})
.catch((error) => {
Expand Down
Loading

0 comments on commit 7b34763

Please sign in to comment.