Skip to content

Commit

Permalink
πŸ”€ merge-in dev
Browse files Browse the repository at this point in the history
commit 85799ca
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 23:49:01 2022 -0500

    πŸ”– 0.3.0

commit 4401513
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 23:44:28 2022 -0500

    πŸ”€ merge-in feature-role-appoint resolve #6

    commit 49908b7
    Author: Evan Elias Young <[email protected]>
    Date:   Sun Mar 13 23:43:37 2022 -0500

        ✨ add /role-appoint command

commit 70a7138
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 23:37:25 2022 -0500

    :bug: no permission needed to enumerate role members

commit f95b6e9
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 19:52:30 2022 -0500

    :ambulance: fix bad import

commit 229b5a2
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 19:47:39 2022 -0500

    πŸ’„ change badge colors

commit 815b2e0
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 19:45:03 2022 -0500

    πŸ’„ add discord.js and discordx badges

commit c4dbaee
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 19:40:56 2022 -0500

    πŸ“ move readme urls to bottom

commit a4f1129
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 19:39:24 2022 -0500

    πŸ”¨ fix format in tag script

commit 605416c
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 19:38:55 2022 -0500

    🎨 fix code-style

commit 656d28e
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 19:37:27 2022 -0500

    πŸ”€ merge-in prune

    commit e80d53a
    Author: Evan Elias Young <[email protected]>
    Date:   Sun Mar 13 19:36:29 2022 -0500

        ✨ add prune command resolve #12

commit 94b4e9e
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 19:29:55 2022 -0500

    πŸ”€ merge-in feature-ping

    commit f068c81
    Author: Evan Elias Young <[email protected]>
    Date:   Sun Mar 13 19:28:42 2022 -0500

        πŸ’„ make ping ephemeral

    commit 5c9f433
    Author: Evan Elias Young <[email protected]>
    Date:   Sun Mar 13 19:28:31 2022 -0500

        πŸ’¬ fix overflow on help descriptions

    commit 5c42f71
    Author: Evan Elias Young <[email protected]>
    Date:   Sun Mar 13 19:25:55 2022 -0500

        ✨ add ping command resolve #9

    commit 4727eab
    Author: Evan Elias Young <[email protected]>
    Date:   Sun Mar 13 19:24:46 2022 -0500

        ✨ add text category to help

    commit b9033ec
    Author: Evan Elias Young <[email protected]>
    Date:   Sun Mar 13 19:21:30 2022 -0500

        πŸ› fix incorrect class name

commit 1cff60e
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 19:11:56 2022 -0500

    ✏️ fix typos in the readme

commit 0bb2ff2
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 19:09:29 2022 -0500

    πŸ”€ merge-in about-member

    commit fb965fc
    Author: Evan Elias Young <[email protected]>
    Date:   Sun Mar 13 19:08:49 2022 -0500

        ✨ add about-user command

    commit 4be60ff
    Author: Evan Elias Young <[email protected]>
    Date:   Sun Mar 13 18:49:03 2022 -0500

        πŸ’¬ standardize about command description

commit b0a7b24
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 18:35:08 2022 -0500

    πŸ”€ merge-in about-channel

    commit fcbd159
    Author: Evan Elias Young <[email protected]>
    Date:   Sun Mar 13 18:09:51 2022 -0500

        ✨ add about-channel command

commit 5fb8cf4
Author: Evan Elias Young <[email protected]>
Date:   Sun Mar 13 18:27:42 2022 -0500

    πŸ› ignore non-react message reactions

commit 490cc77
Author: Evan Elias Young <[email protected]>
Date:   Sat Mar 12 16:17:14 2022 -0600

    🎨 run prettier

commit da9e09b
Author: Evan Elias Young <[email protected]>
Date:   Sat Mar 12 16:10:04 2022 -0600

    πŸš‘ fix bad import path

commit ed2ea03
Author: Evan Elias Young <[email protected]>
Date:   Sat Mar 12 16:09:50 2022 -0600

    πŸ”‡ remove extra log statement

commit 2bae79c
Author: Evan Elias Young <[email protected]>
Date:   Fri Mar 11 23:10:34 2022 -0600

    πŸ”€ merge-in random-commands

    commit ad9352a
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 23:08:51 2022 -0600

        🎨 remove index for native utilities

    commit 94be3e7
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 22:36:34 2022 -0600

        πŸ’¬ quote 8ball response

    commit e8ef11c
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 22:33:47 2022 -0600

        ✨ add /random-8ball command

    commit cc9dcde
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 22:29:05 2022 -0600

        ✨ add /random-flip command

    commit 5a6fb88
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 22:26:56 2022 -0600

        πŸ’¬ make random-range more personable

    commit 76c407d
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 22:21:29 2022 -0600

        🚚 move range command to correct folder

    commit efc0b2c
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 22:20:02 2022 -0600

        πŸ“ date the files from formatting

    commit b0c89c0
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 22:19:02 2022 -0600

        ✨ add /random-range command

    commit 3421b0a
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 22:18:35 2022 -0600

        ✨ add random to command category

commit 149b4f3
Author: Evan Elias Young <[email protected]>
Date:   Fri Mar 11 21:11:48 2022 -0600

    πŸ“ document dev scripts

commit e20826a
Author: Evan Elias Young <[email protected]>
Date:   Fri Mar 11 20:58:49 2022 -0600

    πŸ”€ merge code-style

    commit d254ab8
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 20:55:13 2022 -0600

        🎨 run prettier

    commit 8543f14
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 20:55:00 2022 -0600

        πŸ”¨ update prettier commands

    commit da564f6
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 20:52:54 2022 -0600

        :bug: fix GitHub Action

    commit 6db0d84
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 20:48:40 2022 -0600

        βœ… add GitHub Action style test

    commit f3bd7ed
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 20:39:14 2022 -0600

        πŸ“ add gts badge to readme

    commit 1b580ef
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 20:37:22 2022 -0600

        🎨 run npm fix

    commit 07fba31
    Author: Evan Elias Young <[email protected]>
    Date:   Fri Mar 11 20:35:17 2022 -0600

        βž• add prettier
  • Loading branch information
evaneliasyoung committed Mar 14, 2022
1 parent 00ca273 commit 28289d5
Show file tree
Hide file tree
Showing 70 changed files with 2,579 additions and 1,033 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Code Style

on:
push:
branches-ignore:
- main
pull_request:
branches-ignore:
- main

jobs:
prettier:
runs-on: ubuntu-latest
name: Code Style
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Check Style
uses: actionsx/prettier@v2
with:
args: -c .
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"bracketSpacing": false,
"singleQuote": true,
"trailingComma": "es5",
"arrowParens": "avoid"
}
68 changes: 55 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
# triangle-chan

[![discord.js Version][discordjs-image]][discordjs-url]
[![discordx Version][discordx-image]][discordx-url]
[![Release Version][release-image]][release-url]
[![Beta Version][beta-image]][beta-url]
[![Issues][issues-image]][issues-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![TypeScript Style Guide][gts-image]][gts-url]

Triangle-Chan is a [Discord](https://discord.com/) application with a variety of functions.

Users can create "Reaction Roles," "Counter Channels," and more to organize their serviers.

[release-image]: https://img.shields.io/github/package-json/v/evaneliasyoung/triangle-chan/main
[release-url]: https://github.com/evaneliasyoung/triangle-chan
[beta-image]: https://img.shields.io/github/package-json/v/evaneliasyoung/triangle-chan/dev
[beta-url]: https://github.com/evaneliasyoung/triangle-chan/tree/dev
[issues-image]: https://img.shields.io/github/issues/evaneliasyoung/triangle-chan
[issues-url]: https://github.com/evaneliasyoung/triangle-chan/issues
[snyk-image]: https://snyk.io/test/github/evaneliasyoung/triangle-chan/badge.svg
[snyk-url]: https://snyk.io/test/github/evaneliasyoung/triangle-chan
Users can create "Reaction Roles," "Counter Channels," and more to organize their servers.

## Purpose
### Reaction Roles
### Counter Channels
### Elected & Appointed Roles

- Reaction Roles

- Counter Channels

- About Member / Channel / Server

## Environment

```env
CLIENT_ID=the bot has a user id
BOT_TOKEN=your super secret token goes here
Expand All @@ -33,3 +31,47 @@ DB_NAME=name of the schema
DB_USER=username for the schema
DB_PASS=password for the user
```

## Development Scripts

### `tag.py`

```
./tag.py -h
usage: tag [-h] [--dev] [--force] V
Tags a version for release
positional arguments:
V the new release tag
optional arguments:
-h, --help show this help message and exit
--dev, -d development release, does not commit
--force, -f skip bad version check
```

Running `./tag.py 1.2.3-b4 -d` will locally make changes to `AppInfo` and `package.json`.

Running `./tag.py 1.2.3` will make changes to the above files, commit, push, merge into `main`, and push again.

### `date.py`

Running `./date.py` will update the _second_ dateline annotation in each `.ts` file in the `src` directory.

[discordjs-image]: https://img.shields.io/github/package-json/dependency-version/evaneliasyoung/triangle-chan/discord.js?color=5865F2
[discordjs-url]: https://www.npmjs.com/package/discord.js
[discordx-image]: https://img.shields.io/github/package-json/dependency-version/evaneliasyoung/triangle-chan/discordx?color=5865F2
[discordx-url]: https://www.npmjs.com/package/discordx
[release-image]: https://img.shields.io/github/package-json/v/evaneliasyoung/triangle-chan/main?color=brightgreen
[release-url]: https://github.com/evaneliasyoung/triangle-chan
[beta-image]: https://img.shields.io/github/package-json/v/evaneliasyoung/triangle-chan/dev?color=yellow
[beta-url]: https://github.com/evaneliasyoung/triangle-chan/tree/dev
[issues-image]: https://img.shields.io/github/issues/evaneliasyoung/triangle-chan?color=important
[issues-url]: https://github.com/evaneliasyoung/triangle-chan/issues
[snyk-image]: https://snyk.io/test/github/evaneliasyoung/triangle-chan/badge.svg
[snyk-url]: https://snyk.io/test/github/evaneliasyoung/triangle-chan
[snyk-image]: https://snyk.io/test/github/evaneliasyoung/triangle-chan/badge.svg
[snyk-url]: https://snyk.io/test/github/evaneliasyoung/triangle-chan
[gts-image]: https://img.shields.io/badge/code%20style-google-blueviolet.svg
[gts-url]: https://github.com/google/gts
23 changes: 21 additions & 2 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "triangle-chan",
"version": "0.2.1",
"version": "0.3.0",
"description": "Triangle Fraternity's own waifu Discord bot!",
"keywords": [
"bot",
Expand All @@ -13,7 +13,9 @@
"build": "tsc",
"dev": "node --loader ts-node/esm/transpile-only src/index.ts",
"start": "nodemon --ignore db.json --exec node --loader ts-node/esm/transpile-only src/index.ts",
"serve": "node dist/index.js"
"serve": "node dist/index.js",
"lint": "prettier -c .",
"fix": "prettier -w ."
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -51,6 +53,7 @@
"@types/humanize-duration": "^3.27.1",
"@types/luxon": "^2.0.8",
"@types/node": "^17.0.8",
"prettier": "^2.5.1",
"typescript": "^4.5.4"
},
"engines": {
Expand Down
24 changes: 14 additions & 10 deletions src/commands/about/bot.command.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
/**
* @file bot.command.ts
* @brief The bots information.
* @brief Provides information about Triangle-Chan.
*
* @author Evan Elias Young
* @date 2022-03-05
* @date 2022-03-11
* @date 2022-03-13
* @copyright Copyright 2022 Evan Elias Young. All rights reserved.
*/

import { CommandInteraction } from 'discord.js';
import { Discord, Slash } from 'discordx';
import {CommandInteraction} from 'discord.js';
import {Discord, Slash} from 'discordx';
import EmbedService from '../../services/embed.service.js';
import { InteractionFailedHandlerGenerator, logger } from '../../services/log.service.js';
import {
InteractionFailedHandlerGenerator,
logger,
} from '../../services/log.service.js';
const log = logger(import.meta);
const InteractionFailedHandler = InteractionFailedHandlerGenerator(log);

@Discord()
export abstract class AboutBotCommand {
#embedService = new EmbedService();

@Slash('about-bot', { description: `The bot's information.` })
@Slash('about-bot', {
description: `Provides information about Triangle-Chan.`,
})
async execute(interaction: CommandInteraction) {
const { client } = interaction;
const { user } = client;
const {client} = interaction;
const {user} = client;

if (!user)
return await interaction
.reply(`Oh no! I can't find myself in the Discord registry!`)
.catch(InteractionFailedHandler);

await interaction
.reply({ embeds: [this.#embedService.aboutBotEmbed(client)] })
.reply({embeds: [this.#embedService.aboutBotEmbed(client)]})
.catch(InteractionFailedHandler);
;
}
}
45 changes: 45 additions & 0 deletions src/commands/about/channel.command.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @file channel.command.ts
* @brief Provides information about a channel.
*
* @author Evan Elias Young
* @date 2022-03-13
* @date 2022-03-13
* @copyright Copyright 2022 Evan Elias Young. All rights reserved.
*/

import {CommandInteraction, GuildBasedChannel} from 'discord.js';
import {Discord, Slash, SlashOption} from 'discordx';
import EmbedService from '../../services/embed.service.js';
import {
InteractionFailedHandlerGenerator,
logger,
} from '../../services/log.service.js';
const log = logger(import.meta);
const InteractionFailedHandler = InteractionFailedHandlerGenerator(log);

@Discord()
export abstract class AboutBotCommand {
#embedService = new EmbedService();

@Slash('about-channel', {
description: `Provides information about a channel.`,
})
async execute(
@SlashOption('channel', {
description: 'The channel to learn more about.',
type: 'CHANNEL',
required: false,
})
channel: GuildBasedChannel | null,
interaction: CommandInteraction
) {
await interaction
.reply({
embeds: [
this.#embedService.aboutChannelEmbed(channel ?? interaction.channel!),
],
})
.catch(InteractionFailedHandler);
}
}
17 changes: 10 additions & 7 deletions src/commands/about/server.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@
* @copyright Copyright 2022 Evan Elias Young. All rights reserved.
*/

import { CommandInteraction } from 'discord.js';
import { Discord, Slash } from 'discordx';
import {CommandInteraction} from 'discord.js';
import {Discord, Slash} from 'discordx';
import EmbedService from '../../services/embed.service.js';
import { InteractionFailedHandlerGenerator, logger } from '../../services/log.service.js';
import {
InteractionFailedHandlerGenerator,
logger,
} from '../../services/log.service.js';
const log = logger(import.meta);
const InteractionFailedHandler = InteractionFailedHandlerGenerator(log);

@Discord()
export abstract class AboutServerCommand {
#embedService = new EmbedService();

@Slash('about-server', { description: 'Provides information about a server.' })
@Slash('about-server', {description: 'Provides information about a server.'})
async execute(interaction: CommandInteraction) {
const { guild, member } = interaction;
const {guild, member} = interaction;
if (!guild)
return await interaction
.reply(`I'm having trouble finding the server you're talking about.`)
Expand All @@ -30,8 +33,8 @@ export abstract class AboutServerCommand {
await interaction
.reply({
content: !!member ? `Here you go, ${member}!` : `Here you go!`,
embeds: [await this.#embedService.aboutServerEmbed(guild)]
embeds: [await this.#embedService.aboutServerEmbed(guild)],
})
.catch(InteractionFailedHandler);;
.catch(InteractionFailedHandler);
}
}
46 changes: 46 additions & 0 deletions src/commands/about/user.command.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* @file user.command.ts
* @brief Provides information about a user.
*
* @author Evan Elias Young
* @date 2022-03-13
* @date 2022-03-13
* @copyright Copyright 2022 Evan Elias Young. All rights reserved.
*/

import {CommandInteraction, GuildMember, User} from 'discord.js';
import {Discord, Slash, SlashOption} from 'discordx';
import EmbedService from '../../services/embed.service.js';
import {
InteractionFailedHandlerGenerator,
logger,
} from '../../services/log.service.js';
const log = logger(import.meta);
const InteractionFailedHandler = InteractionFailedHandlerGenerator(log);

@Discord()
export abstract class AboutUserCommand {
#embedService = new EmbedService();

@Slash('about-user', {
description: `Provides information about a user.`,
})
async execute(
@SlashOption('user', {
description: 'The user to learn more about.',
type: 'USER',
required: false,
})
userOpt: User | GuildMember | null,
interaction: CommandInteraction
) {
log.debug('execute about-user', {user: userOpt, interaction});
const {member, user} = interaction;
const arg = userOpt ?? (member as GuildMember | null) ?? user;
await interaction
.reply({
embeds: [this.#embedService.aboutUserEmbed(arg)],
})
.catch(InteractionFailedHandler);
}
}
Loading

0 comments on commit 28289d5

Please sign in to comment.