Skip to content

Commit

Permalink
Merge pull request #17 from EvarinDev/dev
Browse files Browse the repository at this point in the history
Update ads_component
  • Loading branch information
EvarinDev authored Oct 27, 2024
2 parents 1c5ed2c + 0ebccbf commit 92a81fa
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 29 deletions.
1 change: 1 addition & 0 deletions seyfert.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const c = require("./dist/config.js");

module.exports = config.bot({
token: c.default.TOKEN ?? "",
debug: true,
intents: ["Guilds", "GuildVoiceStates"],
locations: {
base: "src/client",
Expand Down
20 changes: 10 additions & 10 deletions src/client/service/commands/LoopCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ServiceExecute } from "@/client/structures/ServiceExecute";
import { IDatabase } from "@/client/interfaces/IDatabase";
import { CommandContext, Embed, UsingClient } from "seyfert";
import { LoopCommandOptions } from "@/client/commands/music/loop";
import { ads_component, ads_image, ads_text } from "@/lib/ad";
import config from "@/config";

const LoopCommand: ServiceExecute = {
name: "LoopCommand",
Expand Down Expand Up @@ -34,16 +34,16 @@ const LoopCommand: ServiceExecute = {
case "song": {
player.setTrackRepeat(true);
interaction.editOrReply({
components: [ads_component],
components: [config.config.ads_component],
embeds: [
new Embed()
.setColor("#a861ff")
.setDescription(`Song loop has been successfully turned ${player.trackRepeat ? "on" : "off"}`)
.setImage(ads_image)
.setImage(config.config.ads_image)
.addFields([
{
name: "Sponsor",
value: ads_text,
value: config.config.ads_text,
inline: false,
},
])
Expand All @@ -55,16 +55,16 @@ const LoopCommand: ServiceExecute = {
case "queue": {
player.setQueueRepeat(true);
interaction.editOrReply({
components: [ads_component],
components: [config.config.ads_component],
embeds: [
new Embed()
.setColor("#a861ff")
.setDescription(`${player.queueRepeat ? "on" : "off"} Queue loop complete`)
.setImage(ads_image)
.setImage(config.config.ads_image)
.addFields([
{
name: "Sponsor",
value: ads_text,
value: config.config.ads_text,
inline: false,
},
])
Expand All @@ -77,16 +77,16 @@ const LoopCommand: ServiceExecute = {
player.setTrackRepeat(false);
player.setQueueRepeat(false);
interaction.editOrReply({
components: [ads_component],
components: [config.config.ads_component],
embeds: [
new Embed()
.setColor("#a861ff")
.setDescription(`Loop closed successfully.`)
.setImage(ads_image)
.setImage(config.config.ads_image)
.addFields([
{
name: "Sponsor",
value: ads_text,
value: config.config.ads_text,
inline: false,
},
])
Expand Down
20 changes: 10 additions & 10 deletions src/client/service/commands/MusicPlay.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CommandContext, UsingClient } from 'seyfert';
import { PlayCommandOptions } from "@/client/commands/music/play";
import { IDatabase } from "@/client/interfaces/IDatabase";
import { ads_component, ads_image, ads_text } from "@/lib/ad";
import { ServiceExecute } from "@/client/structures/ServiceExecute";
import config from '@/config';

const MusicPlay: ServiceExecute = {
name: "MusicPlay",
Expand Down Expand Up @@ -92,7 +92,7 @@ const MusicPlay: ServiceExecute = {
{
const playlist = res.playlist;
await interaction.editOrReply({
components: [ads_component],
components: [config.config.ads_component],
embeds: [
{
author: {
Expand All @@ -102,7 +102,7 @@ const MusicPlay: ServiceExecute = {
title: `\`\`🟢\`\` ${t.play.added_playlist.get()}: \`${playlist.name}\``,
color: 0xa861ff, // Purple color
image: {
url: ads_image,
url: config.config.ads_image,
},
fields: [
{
Expand All @@ -117,7 +117,7 @@ const MusicPlay: ServiceExecute = {
},
{
name: "Sponsor",
value: ads_text,
value: config.config.ads_text,
inline: false,
},
],
Expand All @@ -137,7 +137,7 @@ const MusicPlay: ServiceExecute = {
{
const track = res.tracks[0];
await interaction.editOrReply({
components: [ads_component],
components: [config.config.ads_component],
embeds: [
{
author: {
Expand All @@ -147,7 +147,7 @@ const MusicPlay: ServiceExecute = {
title: `\`\`🟢\`\` ${t.play.added_song.get()}: \`${track.title}\``,
color: 0xa861ff, // Purple color
image: {
url: ads_image,
url: config.config.ads_image,
},
fields: [
{
Expand All @@ -162,7 +162,7 @@ const MusicPlay: ServiceExecute = {
},
{
name: "Sponsor",
value: ads_text,
value: config.config.ads_text,
inline: false,
},
],
Expand Down Expand Up @@ -194,7 +194,7 @@ const MusicPlay: ServiceExecute = {
player.queue.add(track);

await interaction.editOrReply({
components: [ads_component],
components: [config.config.ads_component],
embeds: [
{
author: {
Expand All @@ -204,7 +204,7 @@ const MusicPlay: ServiceExecute = {
title: `\`\`🟢\`\` ${t.play.added_song.get()}: \`${track.title}\``,
color: 0xa861ff, // Purple color
image: {
url: ads_image,
url: config.config.ads_image,
},
fields: [
{
Expand All @@ -219,7 +219,7 @@ const MusicPlay: ServiceExecute = {
},
{
name: "Sponsor",
value: ads_text,
value: config.config.ads_text,
inline: false,
},
],
Expand Down
4 changes: 2 additions & 2 deletions src/client/structures/ServiceExecute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class ServiceLoader {
name: guild.name,
roomid: "0",
lang: $Enums.Lang.en,
room: { id: "0", message: "0" },
room: { id: "0", message: "0", uuid: "" },
};

await this.client.redis.set(`guild:${this.client.me.id}:${guild.id}`, JSON.stringify(database));
Expand All @@ -150,7 +150,7 @@ export class ServiceLoader {
name: data.name || '',
roomid: data.roomid || "0",
lang: data.lang || $Enums.Lang.en,
room: data.room || { id: "0", message: "0" },
room: data.room || { id: "0", message: "0", uuid: "" },
};
}

Expand Down
3 changes: 1 addition & 2 deletions src/client/structures/Starlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export class Starlight extends Client {
super({
shards: {
start: getInfo().FIRST_SHARD_ID,
end: getInfo().LAST_SHARD_ID,
total: getInfo().TOTAL_SHARDS
end: getInfo().SHARD_LIST.length,
},
commands: {
defaults: {
Expand Down
16 changes: 16 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { NodeOptions } from "sakulink";
import "dotenv/config";
import { ActionRow, BuilderComponents, Button } from "seyfert";

const config: { [key: string]: IConfig } = {
development: {
TOKEN: process.env.DEVELOPMENT_TOKEN,
REDIS: process.env.DEVELOPMENT_REDIS,
config: {
ads_text: "กำลังมองหาเซิร์ฟเวอร์ Minecraft แนว PvP หรือ SMP อยู่ใช่ไหม?",
ads_image: "https://cdn.faystarnext.studio/RinthongAds.png",
ads_component: new ActionRow().addComponents(new Button().setLabel("Link").setStyle(5).setEmoji("🔗").setURL("https://discord.gg/gsHWw9XyE6"))
},
Lavalink: [
{
identifier: "Jirayu.net[0] [recommend]",
Expand All @@ -20,6 +26,11 @@ const config: { [key: string]: IConfig } = {
production: {
TOKEN: process.env.PRODUCTION_TOKEN,
REDIS: process.env.PRODUCTION_REDIS,
config: {
ads_text: "กำลังมองหาเซิร์ฟเวอร์ Minecraft แนว PvP หรือ SMP อยู่ใช่ไหม?",
ads_image: "https://cdn.faystarnext.studio/RinthongAds.png",
ads_component: new ActionRow().addComponents(new Button().setLabel("Link").setStyle(5).setEmoji("🔗").setURL("https://discord.gg/gsHWw9XyE6"))
},
Lavalink: [
{
identifier: "Jirayu.net[1]",
Expand All @@ -40,4 +51,9 @@ interface IConfig {
REDIS?: string;
DSA?: string;
TOKEN: string;
config: {
ads_text: string;
ads_image: string;
ads_component: ActionRow<BuilderComponents>;
};
}
5 changes: 0 additions & 5 deletions src/lib/ad.ts

This file was deleted.

0 comments on commit 92a81fa

Please sign in to comment.