Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 新しいjMSのためにチャンネルIDなどを更新 #161

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ConfigInterface {
vcSpeechLog?: string
}
role?: {
mailVerified?: string
verified?: string
}
}
translateGasUrl?: string
Expand All @@ -30,8 +30,8 @@ export class Configuration extends ConfigFramework<ConfigInterface> {
config.discord.channel?.greeting === undefined ||
typeof config.discord.channel.greeting === 'string',
'discord.role.mailVerified must be a string': (config) =>
config.discord.role?.mailVerified === undefined ||
typeof config.discord.role.mailVerified === 'string',
config.discord.role?.verified === undefined ||
typeof config.discord.role.verified === 'string',
'translateGasUrl must be a string': (config) =>
config.translateGasUrl === undefined ||
typeof config.translateGasUrl === 'string',
Expand Down
10 changes: 5 additions & 5 deletions src/events/greeting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export class GreetingEvent extends BaseDiscordEvent<'messageCreate'> {
async execute(message: Message<boolean>): Promise<void> {
const config: Configuration = this.discord.getConfig()
const greetingChannelId =
config.get('discord').channel?.greeting || '603841992404893707'
const mailVerifiedRoleId =
config.get('discord').role?.mailVerified || '597421078817669121'
config.get('discord').channel?.greeting || '1149587870273773569'
const verifiedRoleId =
config.get('discord').role?.verified || '1149583365708709940'

// #greeting チャンネル以外は無視
if (message.channel.id !== greetingChannelId) return
Expand All @@ -45,7 +45,7 @@ export class GreetingEvent extends BaseDiscordEvent<'messageCreate'> {
}

const member = message.member
const isMailVerified = member.roles.cache.has(mailVerifiedRoleId)
const isMailVerified = member.roles.cache.has(verifiedRoleId)

// jao メッセージの場合
if (message.content === 'jao') {
Expand Down Expand Up @@ -77,7 +77,7 @@ export class GreetingEvent extends BaseDiscordEvent<'messageCreate'> {
this.jaoPostedUsers.delete(message.author.id)
await message.react('\u2B55')

await message.member.roles.add(mailVerifiedRoleId)
await message.member.roles.add(verifiedRoleId)

await message.reply(
[
Expand Down