Skip to content

Commit

Permalink
Merge staging into main
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Sep 3, 2023
2 parents 566b200 + 38963cc commit ceb737c
Show file tree
Hide file tree
Showing 21 changed files with 960 additions and 815 deletions.
51 changes: 28 additions & 23 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,33 @@ module.exports = {
es6: true,
node: true
},
extends: 'standard-with-typescript',
parserOptions: {
ecmaVersion: 2020,
project: './tsconfig.json',
sourceType: 'module'
},
plugins: ['unicorn'],
rules: {
'max-len': [
'error',
120,
{
comments: 80,
ignoreRegExpLiterals: true,
ignoreTemplateLiterals: true,
tabWidth: 2
overrides: [
{
files: ['*.js', '*.ts', '*.ts', '*.tsx'],
extends: 'standard-with-typescript',
parserOptions: {
ecmaVersion: 2020,
project: './tsconfig.json',
sourceType: 'module'
},
plugins: ['unicorn'],
rules: {
'max-len': [
'error',
120,
{
comments: 80,
ignoreRegExpLiterals: true,
ignoreTemplateLiterals: true,
tabWidth: 2
}
],
'no-duplicate-imports': 'error',
'sort-imports': 'error',
'unicorn/prefer-node-protocol': 'error',
'@typescript-eslint/explicit-member-accessibility': 'error',
'@typescript-eslint/method-signature-style': 'off'
}
],
'no-duplicate-imports': 'error',
'sort-imports': 'error',
'unicorn/prefer-node-protocol': 'error',
'@typescript-eslint/explicit-member-accessibility': 'error',
'@typescript-eslint/method-signature-style': 'off'
}
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/cleanup-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Delete old versions
uses: snok/container-retention-policy@2ebfab771446f9cde79044dab61eec867ac1d62b # v2.1.1
uses: snok/container-retention-policy@04c70fd030033036d69c0057e0d125bf25820544 # v2.1.2
with:
image-names: ${{ env.IMAGE_NAMES }}
cut-off: 2 days ago UTC
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
stage: ${{ steps.get_metadata.outputs.stage }}
steps:
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

- name: Get metadata
id: get_metadata
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Checkout code
if: fromJSON(needs.metadata.outputs.has_diff)
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

- name: Run merge
if: fromJSON(needs.metadata.outputs.has_diff)
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
((github.event.inputs.merge != 'y' || !fromJSON(needs.metadata.outputs.has_diff)) && !cancelled()))
steps:
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ needs.merge.outputs.sha }}

Expand All @@ -138,7 +138,7 @@ jobs:
env: ${{ needs.metadata.outputs.stage }}

- name: Deploy
uses: appleboy/ssh-action@334f9259f2f8eb3376d33fa4c684fff373f2c2a6 # v0.1.10
uses: appleboy/ssh-action@55dabf81b49d4120609345970c91507e2d734799 # v1.0.0
env:
STAGE: ${{ needs.metadata.outputs.stage }}
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ inputs.sha }}

Expand All @@ -37,7 +37,7 @@ jobs:
needs: build
steps:
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ inputs.sha }}

Expand All @@ -48,7 +48,7 @@ jobs:
- name: Download actionlint
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.24
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.25
- name: Load test image
uses: guidojw/actions/load-docker-image@870d7c8de5aeb08420bb88d8fbddb0222a9eac61 # v1.4.0
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,24 @@ jobs:
needs: metadata
steps:
- name: Checkout code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
ref: ${{ inputs.sha }}
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.10.0

- name: Login to GitHub Container Registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # tag=v2.1.0
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
registry: ${{ vars.DOCKER_REGISTRY_URL }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push image
id: build_push_image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4.1.1
with:
push: true
context: .
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.2.0
20.5.1
440 changes: 220 additions & 220 deletions .yarn/releases/yarn-3.6.0.cjs → .yarn/releases/yarn-3.6.3.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-3.6.0.cjs
yarnPath: .yarn/releases/yarn-3.6.3.cjs
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.2.0@sha256:14f0471d0478fbb9177d0f9e8c146dc872273dcdcfc7fea93a27ed81fc6b0e96
FROM node:20.5.1@sha256:8d9887b3b05d2e65598a18616c37cfc271346d12248dfcbeadd7b7bf4da1e827

ARG NODE_ENV
ENV NODE_ENV=$NODE_ENV
Expand Down
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,43 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@sentry/integrations": "^7.54.0",
"@sentry/node": "^7.54.0",
"axios": "^1.4.0",
"@sentry/integrations": "^7.66.0",
"@sentry/node": "^7.66.0",
"axios": "^1.5.0",
"class-validator": "^0.14.0",
"common-tags": "^1.8.2",
"discord.js": "^14.11.0",
"dotenv": "^16.1.4",
"discord.js": "^14.13.0",
"dotenv": "^16.3.1",
"emoji-regex": "^10.2.1",
"inversify": "^6.0.1",
"lodash": "^4.17.21",
"node-cron": "^3.0.2",
"pg": "^8.11.0",
"pg": "^8.11.3",
"pg-hstore": "^2.3.4",
"pluralize": "^8.0.0",
"typeorm": "^0.3.16",
"typeorm": "^0.3.17",
"ws": "^8.13.0"
},
"devDependencies": {
"@guidojw/bloxy": "^5.7.6",
"@types/common-tags": "^1.8.1",
"@types/lodash": "^4.14.195",
"@types/node": "^18.16.16",
"@types/node-cron": "^3.0.7",
"@types/pluralize": "^0.0.29",
"@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"eslint": "^8.42.0",
"eslint-config-standard-with-typescript": "^35.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.0",
"@types/lodash": "^4.14.197",
"@types/node": "^18.17.14",
"@types/node-cron": "^3.0.8",
"@types/pluralize": "^0.0.30",
"@types/ws": "^8.5.5",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"eslint": "^8.48.0",
"eslint-config-standard-with-typescript": "^39.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.0.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^47.0.0",
"eslint-plugin-unicorn": "^48.0.1",
"reflect-metadata": "^0.1.13",
"typescript": "^5.0.4"
"typescript": "^5.2.2"
},
"engines": {
"node": ">=16.6.0"
},
"packageManager": "[email protected].0"
"packageManager": "[email protected].3"
}
2 changes: 1 addition & 1 deletion src/client/events/guild-member-add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class GuildMemberAddEventHandler implements BaseHandler {
if (welcomeChannelsGroup !== null && welcomeChannelsGroup.isChannelGroup() &&
welcomeChannelsGroup.channels.cache.size > 0) {
const embed = new EmbedBuilder()
.setTitle(`Hey ${member.user.tag},`)
.setTitle(`Hey ${member.user.username},`)
.setDescription(`You're the **${getOrdinalNum(guild.memberCount)}** member on **${guild.name}**!`)
.setThumbnail(member.user.displayAvatarURL())
.setColor(context.primaryColor ?? applicationConfig.defaultColor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class PersistentRolesCommand extends SubCommandCommand<Persistent
}

const embed = new EmbedBuilder()
.setTitle(`${member.user.tag}'s Persistent Roles`)
.setTitle(`${member.user.username}'s Persistent Roles`)
.setDescription(persistentRoles.map(role => role.toString()).toString())
.setColor(context.primaryColor ?? applicationConfig.defaultColor)
await interaction.reply({ embeds: [embed] })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class BoostInfoCommand extends Command {
await member.user.fetch()
}
const embed = new EmbedBuilder()
.setTitle(`${member.user.tag} ${emoji?.toString() ?? ''}`)
.setTitle(`${member.user.username} ${emoji?.toString() ?? ''}`)
.setThumbnail(member.user.displayAvatarURL())
.setDescription(`Has been boosting this server for **${pluralize('month', months, true)}** and **${pluralize('day', days, true)}**!`)
.setFooter({ text: '* Discord Nitro months are 30 days long.' })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class PollCommand extends Command {
}
const embed = new EmbedBuilder()
.setDescription(poll)
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.displayAvatarURL() })
.setAuthor({ name: interaction.user.username, iconURL: interaction.user.displayAvatarURL() })
.setColor(context?.primaryColor ?? applicationConfig.defaultColor)

const newMessage = await interaction.reply({ embeds: [embed], fetchReply: true })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class SuggestCommand extends Command {
const authorUrl = `https://discord.com/users/${interaction.user.id}`
const embed = new EmbedBuilder()
.setDescription(suggestion)
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.displayAvatarURL(), url: authorUrl })
.setAuthor({ name: interaction.user.username, iconURL: interaction.user.displayAvatarURL(), url: authorUrl })
.setColor(0x000af43)
if (attachment !== null) {
if (attachment.height !== null) {
Expand Down
2 changes: 1 addition & 1 deletion src/jobs/premium-members-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class PremiumMembersReportJob implements BaseJob {
for (const { member, months } of monthlyPremiumMembers) {
embed.addFields([
{
name: `${member.user.tag} ${emoji?.toString() ?? ''}`,
name: `${member.user.username} ${emoji?.toString() ?? ''}`,
value: `Has been boosting this server for **${pluralize('month', months, true)}**!`
}
])
Expand Down
2 changes: 1 addition & 1 deletion src/loaders/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function init (): Promise<AroraClient> {
await client.login(process.env.DISCORD_TOKEN)
} catch (err) {
console.error(err)
client.destroy()
await client.destroy()
process.exit(1)
}

Expand Down
2 changes: 1 addition & 1 deletion src/managers/guild-ticket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class GuildTicketManager extends DataManager<number, Ticket, Tick
throw new Error('Invalid ticket type.')
}

const channelName = `${ticketType.name}-${author.user.tag}`
const channelName = `${ticketType.name}-${author.user.username}`
const permissionOverwrites = this.context.ticketsCategory?.permissionOverwrites.cache.toJSON() ?? []
let channel
try {
Expand Down
2 changes: 1 addition & 1 deletion src/structures/guild-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export default class GuildContext extends BaseStructure<GuildEntity> {
}

const embed = new EmbedBuilder()
.setAuthor({ name: author.tag, iconURL: author.displayAvatarURL() })
.setAuthor({ name: author.username, iconURL: author.displayAvatarURL() })
.setColor(this.primaryColor ?? applicationConfig.defaultColor)
.setDescription(content)
if (typeof options.color !== 'undefined') {
Expand Down
8 changes: 4 additions & 4 deletions src/structures/ticket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default class Ticket extends BaseStructure<TicketEntity> {
...this.moderators.cache.map(moderator => moderator.partial && moderator.fetch())
])
let moderatorsString = makeCommaSeparatedString(this.moderators.cache.map((moderator: GuildMember) => {
return `**${moderator.user.tag ?? moderator.id}**`
return `**${moderator.user.username ?? moderator.id}**`
}))
if (moderatorsString === '') {
moderatorsString = 'none'
Expand All @@ -205,7 +205,7 @@ export default class Ticket extends BaseStructure<TicketEntity> {
const embed = new EmbedBuilder()
.setColor(this.context.primaryColor ?? applicationConfig.defaultColor)
.setAuthor({
name: this.author?.user?.tag ?? this.authorId ?? 'unknown',
name: this.author?.user?.username ?? this.authorId ?? 'unknown',
iconURL: this.author?.user?.displayAvatarURL()
})
.setTitle('Ticket Rating')
Expand All @@ -230,7 +230,7 @@ export default class Ticket extends BaseStructure<TicketEntity> {
}
const { robloxId, robloxUsername } = await this.fetchAuthorData()
output += 'AUTHOR INFORMATION\n'
output += `Discord tag: ${this.author?.user?.tag ?? 'unknown'}\nDiscord ID: ${this.authorId ?? 'unknown'}\n`
output += `Discord username: ${this.author?.user?.username ?? 'unknown'}\nDiscord ID: ${this.authorId ?? 'unknown'}\n`
output += `Roblox username: ${robloxUsername ?? 'unknown'}\nRoblox ID: ${robloxId ?? 'unknown'}\n\n`

output += `Created at: ${this.channel.createdAt.toString()}\nClosed at: ${new Date().toString()}\n\n`
Expand All @@ -248,7 +248,7 @@ export default class Ticket extends BaseStructure<TicketEntity> {
}
for (const message of messages.values()) {
if (message.content !== '' || message.attachments.size > 0) {
output += `Sent by: ${message.author.tag} (${message.author.id})\n\n`
output += `Sent by: ${message.author.username} (${message.author.id})\n\n`

if (message.content !== '') {
output += ` ${message.cleanContent}\n\n`
Expand Down
Loading

0 comments on commit ceb737c

Please sign in to comment.