Skip to content

Commit

Permalink
fix: permission to use app commands
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelMedeiros committed Jan 5, 2024
1 parent eb3fa5d commit 1583567
Show file tree
Hide file tree
Showing 21 changed files with 27 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/config/discord.config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ export class DiscordConfigService implements DiscordOptionsFactory {
return {
token: this.cfgService.get<string>('DISCORD_API_KEY'),
discordClientOptions: {
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildIntegrations,
],
},
registerCommandOptions: [
{
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/address.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'address',
description: 'Information about an address',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@UsePipes(TransformPipe, ValidationPipe)
@Injectable()
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/alert-fee.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'fee-alert',
description: 'Create an alert fee.',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@UsePipes(TransformPipe, ValidationPipe)
@Injectable()
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/alert-price.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'price-alert',
description: 'Create an alert price.',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@UsePipes(TransformPipe, ValidationPipe)
@Injectable()
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/alert-tx.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'transaction-alert',
description: 'Create new transaction alert',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@UsePipes(TransformPipe, ValidationPipe)
@Injectable()
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/block.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'block',
description: 'Show bitcoin block stats',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@UsePipes(TransformPipe, ValidationPipe)
@Injectable()
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/convert.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'convert',
description: 'Convert bitcoin <-> fiat',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@UsePipes(TransformPipe, ValidationPipe)
@Injectable()
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/difficulty.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'difficulty',
description: 'Difficulty adjustment and hashrate information',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class DifficultyCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/fees.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'fees',
description: 'Recommend fees information',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class FeesCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/lightning-stats.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'lightning-stats',
description: 'Statistics about the Lightning Network',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class LightningStatsCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/lightning-top.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'lightning-top',
description: 'Top Lightning Nodes',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class LightningTopCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/market-cap.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { group } from 'console'
@Command({
name: 'market-cap',
description: 'Market capitalization information',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class MarketCapCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/my-alert-fee.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { MurrayServiceRepository } from '../repositories'
@Command({
name: 'fee-alert-list',
description: 'List my fee alerts.',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class MyAlertFeeCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/my-alert-price.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { MurrayServiceRepository } from '../repositories'
@Command({
name: 'price-alert-list',
description: 'List my price alerts.',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class MyAlertPriceCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/my-alert-tx.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { MurrayServiceRepository } from '../repositories'
@Command({
name: 'transaction-alert-list',
description: 'List my transaction alerts.',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class MyAlertTxCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/node-stats.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'node-stats',
description: 'Show lightning node stats',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@UsePipes(TransformPipe, ValidationPipe)
@Injectable()
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/op-return.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'opreturn',
description: 'Write data to the blockchain',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class OpReturnCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/price.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'price',
description: 'Show bitcoin fiat price',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class PriceCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/rank.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'rank',
description: 'Tip Rank',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@Injectable()
export class RankCommand implements DiscordCommand {
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/tip.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ok } from 'assert'
@Command({
name: 'tip',
description: 'Send a tip to Murray Rothbot! We need your help to keep the lights on!',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@UsePipes(TransformPipe, ValidationPipe)
@Injectable()
Expand Down
1 change: 1 addition & 0 deletions src/domain/bot/commands/transaction.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { createResponse } from 'src/utils/default-response'
@Command({
name: 'transaction',
description: 'Information about a transaction',
defaultMemberPermissions: ['UseApplicationCommands'],
})
@UsePipes(TransformPipe, ValidationPipe)
@Injectable()
Expand Down

0 comments on commit 1583567

Please sign in to comment.