-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from Thomasparsley/Dev
Dev merge to Main
- Loading branch information
Showing
26 changed files
with
423 additions
and
312 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
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
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
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import { OnGuildMemberAddAction } from "../types" | ||
|
||
export const onGuildMemberAdd: OnGuildMemberAddAction = async ({ member }) => { | ||
|
||
} | ||
export const onGuildMemberAdd: OnGuildMemberAddAction = async ({ member }) => {} |
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 |
---|---|---|
@@ -1,5 +1,32 @@ | ||
import { OnReactionAddAction } from "../types" | ||
|
||
export const onReactionAdd: OnReactionAddAction = async ({ reaction, user }) => { | ||
console.log(`${user.username} použil reakci ${reaction.emoji}!`) | ||
} | ||
export const onReactionAdd: OnReactionAddAction = async ({ reactionMessages, reaction, user }) => { | ||
if(user.bot){ | ||
return; | ||
} | ||
|
||
const messageId = reaction.message.id | ||
if(!reactionMessages.has(messageId)){ | ||
return; | ||
} | ||
|
||
const removeAction = reaction.users.remove(user.id) | ||
|
||
const reactionBinds = reactionMessages.get(messageId)! | ||
const guild = reaction.message.guild! | ||
const roleName = reactionBinds.get(reaction.emoji.toString()) | ||
|
||
if(roleName !== undefined){ | ||
const role = await guild.roles.cache.find(role => role.name === roleName)!.id | ||
const gulidMember = await guild.members.fetch(user.id) | ||
|
||
if(gulidMember.roles.cache.has(role)){ | ||
await gulidMember.roles.remove(role) | ||
} | ||
else { | ||
await gulidMember.roles.add(role) | ||
} | ||
} | ||
|
||
await removeAction; | ||
} |
Oops, something went wrong.