mirror of
https://github.com/hrfee/jfa-go.git
synced 2025-01-03 23:10:11 +00:00
Compare commits
2 Commits
15e5564b12
...
4deb45df3c
Author | SHA1 | Date | |
---|---|---|---|
4deb45df3c | |||
4b02960fd1 |
@ -31,6 +31,10 @@
|
|||||||
background: #202020;
|
background: #202020;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dark .code {
|
||||||
|
color: var(--color-content-high);
|
||||||
|
}
|
||||||
|
|
||||||
html:not(.dark) .card.\@low:not(.\~neutral):not(.\~positive):not(.\~urge):not(.\~warning):not(.\~info):not(.\~critical) {
|
html:not(.dark) .card.\@low:not(.\~neutral):not(.\~positive):not(.\~urge):not(.\~warning):not(.\~info):not(.\~critical) {
|
||||||
--color-fill: va(--color-fill);
|
--color-fill: va(--color-fill);
|
||||||
--color-content: var(--color-content);
|
--color-content: var(--color-content);
|
||||||
|
24
discord.go
24
discord.go
@ -310,19 +310,21 @@ func (d *DiscordDaemon) registerCommands() {
|
|||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
|
||||||
d.deregisterCommands()
|
// d.deregisterCommands()
|
||||||
|
|
||||||
d.commandIDs = make([]string, len(commands))
|
d.commandIDs = make([]string, len(commands))
|
||||||
cCommands, err := d.bot.ApplicationCommandBulkOverwrite(d.bot.State.User.ID, d.guildID, commands)
|
// cCommands, err := d.bot.ApplicationCommandBulkOverwrite(d.bot.State.User.ID, d.guildID, commands)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
d.app.err.Printf("Discord: Cannot create commands: %v", err)
|
// d.app.err.Printf("Discord: Cannot create commands: %v", err)
|
||||||
}
|
// }
|
||||||
for i, cmd := range cCommands {
|
for i, cmd := range commands {
|
||||||
// command, err := d.bot.ApplicationCommandCreate(d.bot.State.User.ID, d.guildID, cmd)
|
command, err := d.bot.ApplicationCommandCreate(d.bot.State.User.ID, d.guildID, cmd)
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// d.app.err.Printf("Discord: Cannot create command \"%s\": %v", cmd.Name, err)
|
d.app.err.Printf("Discord: Cannot create command \"%s\": %v", cmd.Name, err)
|
||||||
// }
|
} else {
|
||||||
d.commandIDs[i] = cmd.ID
|
d.app.debug.Printf("Discord: registered command \"%s\"", cmd.Name)
|
||||||
|
d.commandIDs[i] = command.ID
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ if .captcha }}
|
{{ if .captcha }}
|
||||||
<div class="card ~neutral @low mb-4">
|
<div class="card ~neutral @low mb-4">
|
||||||
<span class="label supra mb-2">CAPTCHA <span id="captcha-success" class="badge lg @low ~critical ml-2 float-right"><i class="ri-close-line"></i></span></span>
|
<span class="label supra mb-2">CAPTCHA <span id="captcha-regen" title="{{ .strings.refresh }}" class="badge lg @low ~info ml-2 float-right"><i class="ri-refresh-line"></i></span><span id="captcha-success" class="badge lg @low ~critical ml-2 float-right"><i class="ri-close-line"></i></span></span>
|
||||||
<div id="captcha-img" class="mt-2 mb-2"></div>
|
<div id="captcha-img" class="mt-2 mb-2"></div>
|
||||||
<input class="field ~neutral @low" id="captcha-input" class="mt-2" placeholder="CAPTCHA">
|
<input class="field ~neutral @low" id="captcha-input" class="mt-2" placeholder="CAPTCHA">
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
"linkDiscord": "Link Discord",
|
"linkDiscord": "Link Discord",
|
||||||
"linkMatrix": "Link Matrix",
|
"linkMatrix": "Link Matrix",
|
||||||
"contactDiscord": "Contact through Discord",
|
"contactDiscord": "Contact through Discord",
|
||||||
"theme": "Theme"
|
"theme": "Theme",
|
||||||
|
"refresh": "Refresh"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,7 @@ let captchaVerified = false;
|
|||||||
let captchaID = "";
|
let captchaID = "";
|
||||||
let captchaInput = document.getElementById("captcha-input") as HTMLInputElement;
|
let captchaInput = document.getElementById("captcha-input") as HTMLInputElement;
|
||||||
|
|
||||||
if (window.captcha) {
|
const genCaptcha = () => {
|
||||||
_get("/captcha/gen/"+window.code, null, (req: XMLHttpRequest) => {
|
_get("/captcha/gen/"+window.code, null, (req: XMLHttpRequest) => {
|
||||||
if (req.readyState == 4) {
|
if (req.readyState == 4) {
|
||||||
if (req.status == 200) {
|
if (req.status == 200) {
|
||||||
@ -279,9 +279,15 @@ if (window.captcha) {
|
|||||||
document.getElementById("captcha-img").innerHTML = `
|
document.getElementById("captcha-img").innerHTML = `
|
||||||
<img class="w-100" src="${window.location.toString().substring(0, window.location.toString().lastIndexOf("/invite"))}/captcha/img/${window.code}/${captchaID}"></img>
|
<img class="w-100" src="${window.location.toString().substring(0, window.location.toString().lastIndexOf("/invite"))}/captcha/img/${window.code}/${captchaID}"></img>
|
||||||
`;
|
`;
|
||||||
|
captchaInput.value = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
if (window.captcha) {
|
||||||
|
genCaptcha();
|
||||||
|
(document.getElementById("captcha-regen") as HTMLSpanElement).onclick = genCaptcha;
|
||||||
const input = document.querySelector("input[type=submit]") as HTMLInputElement;
|
const input = document.querySelector("input[type=submit]") as HTMLInputElement;
|
||||||
const checkbox = document.getElementById("captcha-success") as HTMLSpanElement;
|
const checkbox = document.getElementById("captcha-success") as HTMLSpanElement;
|
||||||
captchaInput.onkeyup = () => _post("/captcha/verify/" + window.code + "/" + captchaID + "/" + captchaInput.value, null, (req: XMLHttpRequest) => {
|
captchaInput.onkeyup = () => _post("/captcha/verify/" + window.code + "/" + captchaID + "/" + captchaInput.value, null, (req: XMLHttpRequest) => {
|
||||||
|
2
views.go
2
views.go
@ -504,7 +504,7 @@ func (app *appContext) InviteProxy(gc *gin.Context) {
|
|||||||
data["discordUsername"] = app.discord.username
|
data["discordUsername"] = app.discord.username
|
||||||
data["discordRequired"] = app.config.Section("discord").Key("required").MustBool(false)
|
data["discordRequired"] = app.config.Section("discord").Key("required").MustBool(false)
|
||||||
data["discordSendPINMessage"] = template.HTML(app.storage.lang.Form[lang].Strings.template("sendPINDiscord", tmpl{
|
data["discordSendPINMessage"] = template.HTML(app.storage.lang.Form[lang].Strings.template("sendPINDiscord", tmpl{
|
||||||
"command": `<code class="code">/` + app.config.Section("discord").Key("start_command").MustString("start") + `</code>`,
|
"command": `<span class="code font-mono">/` + app.config.Section("discord").Key("start_command").MustString("start") + `</span>`,
|
||||||
"server_channel": app.discord.serverChannelName,
|
"server_channel": app.discord.serverChannelName,
|
||||||
}))
|
}))
|
||||||
data["discordServerName"] = app.discord.serverName
|
data["discordServerName"] = app.discord.serverName
|
||||||
|
Loading…
Reference in New Issue
Block a user