Skip to content

Commit

Permalink
Merge branch 'main' into feat-flagtr
Browse files Browse the repository at this point in the history
  • Loading branch information
saiteja-madha authored Aug 28, 2021
2 parents 187f144 + e9792e4 commit 3e4aef1
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,44 @@ Command | Description
`reminviterank <role-name>` | remove invite rank configured with that role
`invitetracking <ON\|OFF>` | remove invite rank configured with that role

### 📨 Greeting Commands

Replace `cmd` with `welcome` for setting up welcome message and `farewell` for setting up farewell message<br>

Command | Description
------------ | -------------
`cmd [#channel\|off]` | enable or disable greeting message
`cmd preview` | preview the configured greeting message
`cmd desc <text>` | set embed description
`cmd thumbnail <ON\|OFF>` | enable/disable embed thumbnail
`cmd color <hexcolor>` | set embed color
`cmd footer <text>` | set embed footer content

Replacements
```
\n : New Line
{server} : Server Name
{count} : Server member count
{member:name} : Member Name
{member:tag} : Member Tag
{inviter:name} : Inviter Name
{inviter:tag} : Inviter Tag
{invites} : Inviter Invites
```

### Admin Commands

Command | Description
------------ | -------------
`setprefix <new-prefix>` | sets a new prefix for this server
`xpsystem <ON\|OFF>` | enable or disable XP ranking system in the server
`counter <type> <name>` | setup counter channel in the guild. Counter types: `all/members/bots`
`addrr <#channel> <messageid> <emote> <role>` | setup reaction role for the specified message
`removerr <#channel> <messageid>` | remove configured reaction for the specified message


## Credits
Dashboard: [Atlanta](https://github.com/Androz2091/AtlantaBot)

## 🤝 Contributing
Feel free to [Fork](https://github.com/saiteja-madha/discord-js-bot/fork) this repository, create a feature branch and submit a pull request
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord-js-bot",
"version": "2.0.0",
"version": "2.1.0",
"description": "A multipurpose discord bot built using discord-js",
"main": "bot.js",
"author": "Sai Teja M",
Expand Down
5 changes: 3 additions & 2 deletions src/features/automod.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ function run(client) {
});

client.on("messageDelete", async (message) => {
const { channelId, id, guild } = message;
if (!guild) return;
if (message.partial) message = await message.fetch().catch((err) => {});
if (message.partial || message.author.bot || message.channel.type === "DM") return;
if (!message.guild) return;

const settings = (await getSettings(message.guild)).automod;
if (!settings.anti_ghostping || !settings.log_channel) return;
Expand Down
12 changes: 8 additions & 4 deletions src/features/reaction-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ const { loadReactionRoles, getReactionRole } = require("@schemas/reactionrole-sc
async function run(client) {
await loadReactionRoles();

client.on("messageReactionAdd", async (reaction) => {
client.on("messageReactionAdd", async (reaction, user) => {
const data = await fetchRoleData(reaction);
if (data) {
await reaction.message.member.roles.add(reaction.message.guild.roles.cache.get(data.role_id));
let member = await reaction.message.guild.members.fetch(user.id);
if (!member) return;
await member.roles.add(reaction.message.guild.roles.cache.get(data.role_id));
}
});

client.on("messageReactionRemove", async (reaction) => {
client.on("messageReactionRemove", async (reaction, user) => {
const data = await fetchRoleData(reaction);
if (data) {
await reaction.message.member.roles.remove(reaction.message.guild.roles.cache.get(data.role_id));
let member = await reaction.message.guild.members.fetch(user.id);
if (!member) return;
await member.roles.remove(reaction.message.guild.roles.cache.get(data.role_id));
}
});
}
Expand Down

0 comments on commit 3e4aef1

Please sign in to comment.