Skip to content

Commit 2f78fb6

Browse files
author
xyzjesper
committed
Adding fix for role adding in Auth Gate from Verification
1 parent f7b54db commit 2f78fb6

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "disbot",
33
"main": "./.build/startup.js",
4-
"version": "1.6.2r1",
4+
"version": "1.6.2r2",
55
"scripts": {
66
"disbot": "node ./.build/src/main/startup.js",
77
"customer": "cd /home/disbot && node ./.build/src/main/startup.js",

src/api/public/html/verify.ejs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@
9393
</svg>
9494
<h1>Congratulations, you are <span class="highlight">verified!</span></h1>
9595
<p>
96-
Your server now has the official Discord Verified badge.<br />
97-
Enjoy exclusive features and greater security.
96+
You passed the Verification gate! (You only can verify once)
9897
</p>
9998
</section>
10099
</body>

src/api/services/app.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,9 @@ export async function app(client: ExtendedClient) {
121121
return
122122
}
123123
for (const roleId of gate.Roles) {
124-
const role = guild.roles.cache.get(roleId);
124+
const role = await guild.roles.fetch(roleId);
125125
if (!role) {
126-
res.status(404).json({error: `Role with ID ${roleId} not found`});
127-
return
126+
continue
128127
}
129128
await guildMemeber.roles.add(role).catch(() => null);
130129
}
@@ -155,10 +154,9 @@ export async function app(client: ExtendedClient) {
155154
return
156155
}
157156
for (const permission of gate.ChannelPermissions) {
158-
const channel = guild.channels.cache.get(permission.ChannelId);
157+
const channel = await guild.channels.fetch(permission.ChannelId);
159158
if (!channel) {
160-
res.status(404).json({error: `Channel with ID ${permission.ChannelId} not found`});
161-
return
159+
continue
162160
}
163161
await (channel as GuildChannel).permissionOverwrites.create(guildMemeber, {
164162
[String(permission.Permission)]: true,

src/main/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export const botData = {
2-
version: "1.6.2r1",
2+
version: "1.6.2r2",
33
configVersion: "1.2.0",
44
};

0 commit comments

Comments
 (0)