-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23e4420
commit c144354
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { client } from '../index'; | ||
import { ChannelType, Events } from 'discord.js'; | ||
import { getGeneralChannel } from '../util'; | ||
|
||
client.on(Events.GuildMemberAdd, async (member) => { | ||
const generalChannel = await getGeneralChannel(); | ||
|
||
if (generalChannel?.type !== ChannelType.GuildText) { | ||
throw new Error('General channel is not a text channel.'); | ||
} | ||
|
||
await generalChannel.send( | ||
`Heya~ ${member.displayName}! Welcome to the Fyra Discord, we're the home of products such as tauOS: the next generation, friendly, and private operating system. Our server is also a chill place to talk tech and hangout. If you have any questions, feel free to ask! :3` | ||
); | ||
await generalChannel.send( | ||
`By the way, my name is Raboneko, Fyra's virtual neko assistant, *nya~* It's a pleasure to meet nyu, and I hope you have a great time here as well ^_^` | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { client } from '../index'; | ||
import { Events } from 'discord.js'; | ||
|
||
const mentionedResponses = [ | ||
'nyes?', | ||
'hewwo~', | ||
'oww, that was loud >_<', | ||
'your friendly robot neko, at your service :3', | ||
'nya?!', | ||
'huh?', | ||
'*runs with toast in mouth*', | ||
'how are nyu?', | ||
'hai!', | ||
'gmeow~' | ||
]; | ||
|
||
client.on(Events.MessageCreate, async (message) => { | ||
const me = client.user?.id; | ||
if (!me || !message.mentions.has(me)) { | ||
return; | ||
} | ||
await message.reply(mentionedResponses[Math.floor(Math.random() * mentionedResponses.length)]); | ||
}); |