Skip to content

Commit

Permalink
Support for beta "jank" bot
Browse files Browse the repository at this point in the history
  • Loading branch information
track8regret committed Sep 19, 2024
1 parent 3748957 commit a3f0d4d
Show file tree
Hide file tree
Showing 5 changed files with 377 additions and 142 deletions.
11 changes: 6 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
APP_ID =
PUBLIC_KEY =
TOKEN =
TOP_GG =
TEST_SERVER =
APP_ID=
PUBLIC_KEY=
TOKEN=
TOP_GG=
TEST_SERVER=
JANK=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ web_modules/

# dotenv environment variable files
.env
jank.env
.env.development.local
.env.test.local
.env.production.local
Expand Down
24 changes: 15 additions & 9 deletions src/junk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { DuelLinksSetCommand } from './commands/duellinksset.js';
import { MasterDuelSetCommand } from './commands/masterduelset.js';

// grab dotenv variables
const { APP_ID, PUBLIC_KEY, TOKEN, TOP_GG, TEST_SERVER } = process.env;
const { APP_ID, PUBLIC_KEY, TOKEN, TOP_GG, TEST_SERVER, JANK } = process.env;

// make the client
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
Expand All @@ -25,7 +25,13 @@ const creator = new SlashCreator({
});

// set up topgg autoposter
const ap = AutoPoster(TOP_GG!, client)
if (JANK === "false") {
const ap = AutoPoster(TOP_GG!, client)

ap.on('posted', () => {
console.log('Stats posted to Top.gg.')
})
}

await creator
.withServer(
Expand All @@ -40,10 +46,10 @@ await creator

client.login(TOKEN);
client.on('ready', () => {
console.log('Junk Converter online.')
client.user?.setPresence({'status': 'online', 'afk': false, 'activities': [{'name': 'Ishizu Tearlament', 'type': ActivityType.Playing}]})
});

ap.on('posted', () => {
console.log('Stats posted to Top.gg.')
})
if (JANK === "false") {
console.log('Junk Converter online.')
} else {
console.log('Jank Converter online. Let the testing begin.')
}
client.user?.setPresence({'status': 'online', 'afk': false, 'activities': [{'name': 'Plant Link', 'type': ActivityType.Playing}]})
});
Loading

0 comments on commit a3f0d4d

Please sign in to comment.