sylveon / discord-ban-appeals Goto Github PK
View Code? Open in Web Editor NEWSample ban appeals page with OAuth2 integration
Home Page: https://discord-ban-appeal-preview.netlify.app/
License: MIT License
Sample ban appeals page with OAuth2 integration
Home Page: https://discord-ban-appeal-preview.netlify.app/
License: MIT License
Is it possible to talk on discord with the user thanks to the bot?
In the sign in process, an error shows up saying "Invalid URI", I know, The URI needs to be set as the website url thing, but how do i edit that on github?
I don't know if I am doing anything wrong here but after signing in to discord, I get the message
{"errorType":"Error","errorMessage":"Failed to get user access token","trace":["Error: Failed to get user access token"," at Runtime.exports.handler (/var/task/src/func/oauth-callback.js:27:19)"," at processTicksAndRejections (internal/process/task_queues.js:97:5)"]}
This is on a fresh install with no changes being made to source code. Where should I start to troubleshoot this? Does the GitHub repo need to have the same name as the parent repo?
Add option to collect also user's email from Discord oauth. Then staff will be able to reply to the appeal to user's email. Replying to email is better for staff than sending friend requests and waiting for approval ...
This could be used as an anti-spam measure and a way to notify users about the result of their appeal
I don't think it's a big issue but we should do it anyways
{"errorType":"Error","errorMessage":"Failed to get user ban","trace":["Error: Failed to get user ban"," at getBan (/var/task/func/helpers/user-helpers.js:41:15)"," at processTicksAndRejections (internal/process/task_queues.js:95:5)"," at async Runtime.exports.handler (/var/task/func/oauth-callback.js:44:25)"]}
Hi, this is a suggestion/question. I have some experience in JS, but not a lot and I'm still pretty inexperienced with some aspects of the Discord API.
I've tried modifying the appeal form so that once unbanned a user would be automatically readded to the server. I've changed the bot scope to request guild join as well and I've made the following fuctions in https://github.com/sylveon/discord-ban-appeals/blob/master/func/helpers/user-helpers.js:
function callGuildJoinApi(userId, guildId, botToken, method) {
return fetch(`${API_ENDPOINT}/guilds/${encodeURIComponent(guildId)}/members/${encodeURIComponent(userId)}`, {
method: method,
headers: {
"Authorization": `Bot ${botToken}`,
"Content-Type": "application/json",
}
});
}
async function guildJoin(userId, guildId, botToken) {
const result = await callGuildJoinApi(userId, guildId, botToken, "PUT");
if (!result.ok && result.status !== 404) {
console.log(await result.json());
throw new Error("Failed to add user to the server.");
}
}
module.exports = { getUserInfo, getBan, unbanUser, guildJoin };
So I tried adding the function on the unban function to also call the guildJoin function which is https://discord.com/developers/docs/resources/guild#add-guild-member
I tested the PUT/guilds/{guild.id}/members/{user.id} in POSTMAN but it requires access_token
which I don't know how to get (or what's it for) and the application gives an error. Is this the application access token for the person that submitted the appeal?
This is the error I get on the console when running via netlify:
1:33:52 PM: bbc7e98c INFO { message: '400: Bad Request', code: 0 }
This is the error I get when testing the PUT request directly:
{
"message": "Invalid OAuth2 access token",
"code": 50025
}
Is this something that's possible to do, while still remaining on a free tier?
j
I guess we are all aware of the increasing phishing attacks discord servers are getting, personally, I have no intention of letting those people that fell for the scam come back.
My idea is to be able to configure a variable or something that the bot checks when the user appeals and if the ban reason contains such word or string (e.g "ToS", "break ToS", "no appeal", "definitive"...) the user will not be able to appeal the ban.
Add option to use just Discord webhook for receiving ban appeals. This would be good for those who don't need to have unban option and dont need bot.
{"errorType":"Error","errorMessage":"Must use import to load ES Module: /var/task/node_modules/node-fetch/src/index.js\nrequire() of ES modules is not supported.\nrequire() of /var/task/node_modules/node-fetch/src/index.js from /var/task/func/oauth-callback.js is an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which defines all .js files in that package scope as ES modules.\nInstead rename index.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /var/task/node_modules/node-fetch/package.json.\n","trace":["Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /var/task/node_modules/node-fetch/src/index.js","require() of ES modules is not supported.","require() of /var/task/node_modules/node-fetch/src/index.js from /var/task/func/oauth-callback.js is an ES module file as it is a .js file whose nearest parent package.json contains \"type\": \"module\" which defines all .js files in that package scope as ES modules.","Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove \"type\": \"module\" from /var/task/node_modules/node-fetch/package.json.",""," at new NodeError (internal/errors.js:322:7)"," at Object.Module._extensions..js (internal/modules/cjs/loader.js:1102:13)"," at Module.load (internal/modules/cjs/loader.js:950:32)"," at Function.Module._load (internal/modules/cjs/loader.js:790:12)"," at Module.require (internal/modules/cjs/loader.js:974:19)"," at require (internal/modules/cjs/helpers.js:93:18)"," at Object.<anonymous> (/var/task/func/oauth-callback.js:1:15)"," at Module._compile (internal/modules/cjs/loader.js:1085:14)"," at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)"," at Module.load (internal/modules/cjs/loader.js:950:32)"]}
i did the steps but it keep showing this
Hi, I was wondering if there was a way to selfhost this rather than on netlify?
Duh
I have 3 suggestions:
I am unable to write my own css since it will only stick to the bootstrap css you have made, if I deleted the link rel in the head, the page will break. Is there a possible way to keep the current css you have made and also allow myself to make changes to style.css.
Hey, so I customized my form but I don't know javascript. How do I make it bypass the ban checking and just let me go to the form like the example you put on this repo's description because I'm getting a 404 error, might be because I deleted the error.html file since I don't need it.
now, i have a domain, pogisle-unban.tk, what should be the redirect URL? i already deployed the website to that domain
Use token in build script w/ discord.js to establish connection. Move package.json to root.
{"errorType":"Error","errorMessage":"Failed to submit message","trace":["Error: Failed to submit message"," at Runtime.exports.handler (/var/task/func/submit-appeal.js:105:19)"," at processTicksAndRejections (internal/process/task_queues.js:97:5)"]}
Plz add auto send the banned person dm that is i approved the unban that it's auto send that person
i want it to dm the person that got banned
Hi after following all the steps the bot is offline and is not working how do i rectify this issue
Netlify has a native OAuth system, we could use this to remove the need for some lambdas.
https://docs.netlify.com/visitor-access/oauth-provider-tokens/
User input is currently passed as is to the webhook, which means the user can use markdown - we should probably at least escape the link syntax, and leave formatting stuff alone.
When I click authorize it redirects me back and then I receive:
{"errorType":"Error","errorMessage":"Failed to get user access token","trace":["Error: Failed to get user access token"," at Runtime.exports.handler (/var/task/src/func/oauth-callback.js:30:19)"," at processTicksAndRejections (internal/process/task_queues.js:97:5)"]}
I managed to customize the site, but how do I duplicate the question fields and still make it send to the embed?
A banned user can create several appeals and flood the channel, which is something I rather not see
Hi, out of the blue users are unable to submit appeals on my server.
I have forked this repo and just translated some things to have it in Spanish, last week it was working just fine.
Now whenever they try to send the form (after logging in) they receive this message:
{"errorType":"SyntaxError","errorMessage":"Unexpected token ] in JSON at position 44","trace":["SyntaxError: Unexpected token ] in JSON at position 44"," at JSON.parse (<anonymous>)"," at Runtime.exports.handler (/var/task/func/submit-appeal.js:37:35)"," at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"]}
I tried to check if there was an error in the code, but I can't find the file submit-appeal.js and I don't know what to do.
Suggestion: add support for hosting on Vercel
Please add option to setup custom ban appeal questions, you should create questions.json where these questions will be.
The bot works but is offline. whats the reason for this?
I get this error: Not Found - Request ID: 01G0YRB0H9VEF4E5GZXQ0R5T7Y
Is there anyway for the bot to DM people when there ban? To send them the link
I'm getting this error
{"errorType":"Error","errorMessage":"Failed to get user ban","trace":["Error: Failed to get user ban"," at getBan (/var/task/src/func/helpers/user-helpers.js:41:15)"," at processTicksAndRejections (internal/process/task_queues.js:97:5)"," at async Runtime.exports.handler (/var/task/src/func/oauth-callback.js:35:25)"]}
User should not be able to use their JWT to call this API. Use a different secret?
Thats what I get when I test it out.
You don't have authorisation to view this page.
HTTP ERROR 403
if i try to connect my discord on the site it says website is unsafe it there a way that you can not see that anymore
Hey so I have followed all setup steps listed however when I click the submit button on the ban appeal i get this error message:
{"errorType":"Error","errorMessage":"Failed to submit message","trace":["Error: Failed to submit message"," at Runtime.handler (/var/task/func/submit-appeal.js:8530:13)"," at processTicksAndRejections (internal/process/task_queues.js:95:5)"]}
Any ideas, everything else works fine however the appeal never gets sent due to that error
Hello, the discord bot isn't going online and when I login to discord with my alt its says "your access to this site is denied" + no one is blocked (http error 403)
Not working
{"errorType":"Error","errorMessage":"Dynamic require of "buffer" is not supported","trace":["Error: Dynamic require of "buffer" is not supported"," at __require (file:///var/task/func/oauth-callback.js:11:9)"," at node_modules/safe-buffer/index.js (file:///var/task/func/oauth-callback.js:4404:18)"," at __require2 (file:///var/task/func/oauth-callback.js:17:44)"," at node_modules/jws/lib/sign-stream.js (file:///var/task/func/oauth-callback.js:4935:19)"," at __require2 (file:///var/task/func/oauth-callback.js:17:44)"," at node_modules/jws/index.js (file:///var/task/func/oauth-callback.js:5115:22)"," at __require2 (file:///var/task/func/oauth-callback.js:17:44)"," at node_modules/jsonwebtoken/decode.js (file:///var/task/func/oauth-callback.js:5148:15)"," at __require2 (file:///var/task/func/oauth-callback.js:17:44)"," at node_modules/jsonwebtoken/index.js (file:///var/task/func/oauth-callback.js:7205:15)"]}
I got some issues. The discord oAuth works really good, but after it just breaks.
https://bans.mrtinsson.com/
I tried to restart the website, but it still didn't work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.