Homepage link

This commit is contained in:
Melon 2022-05-16 12:54:08 +01:00
parent f414dfdb77
commit d42ef41dc0
Signed by: melon
GPG Key ID: B0ADD5395BCDAAB6
3 changed files with 92 additions and 108 deletions

View File

@ -1,17 +0,0 @@
package discord
import (
"bytes"
"github.com/bwmarrin/discordgo"
"image"
)
func getGuildIcon(s *discordgo.Session, guild *discordgo.UserGuild) (image.Image, error) {
body, err := s.RequestWithBucketID("GET", discordgo.EndpointGuildIcon(guild.ID, guild.Icon), nil, discordgo.EndpointGuildIcon(guild.ID, ""))
if err != nil {
return nil, nil
}
img, _, err := image.Decode(bytes.NewReader(body))
return img, err
}

View File

@ -39,87 +39,88 @@
</style>
</head>
<body>
<h1>Discord | Melon Tools</h1>
<h1>Discord | <a href="/">Melon Tools</a></h1>
<div class="page-content">
<div>
{{with .User}}
<p>My User: {{.Username}}#{{.Discriminator}}</p>
<ul>
<li>ID: {{.ID}}</li>
<li>Email: {{.Email}}</li>
<li>Username: {{.Username}}</li>
<li>Avatar: <img {{$.Avatar}}/></li>
<li>Locale: {{.Locale}}</li>
<li>Discriminator: {{.Discriminator}}</li>
<li>Verified: {{.Verified}}</li>
<li>MFA: {{.MFAEnabled}}</li>
<li>Banner: {{.Banner}}</li>
<li>Accent Color: {{$.UserAccent}} <span class="colour-block" style="background-color: {{$.UserAccent}}">&nbsp;</span></li>
<li>Bot: {{.Bot}}</li>
<li>Premium: {{.PremiumType}}</li>
<li>System: {{.System}}</li>
</ul>
<p>My User: {{.Username}}#{{.Discriminator}}</p>
<ul>
<li>ID: {{.ID}}</li>
<li>Email: {{.Email}}</li>
<li>Username: {{.Username}}</li>
<li>Avatar: <img {{$.Avatar}}/></li>
<li>Locale: {{.Locale}}</li>
<li>Discriminator: {{.Discriminator}}</li>
<li>Verified: {{.Verified}}</li>
<li>MFA: {{.MFAEnabled}}</li>
<li>Banner: {{.Banner}}</li>
<li>Accent Color: {{$.UserAccent}} <span class="colour-block" style="background-color: {{$.UserAccent}}">&nbsp;</span>
</li>
<li>Bot: {{.Bot}}</li>
<li>Premium: {{.PremiumType}}</li>
<li>System: {{.System}}</li>
</ul>
{{end}}
</div>
<div>
{{with .User.PublicFlags}}
<p>My Flags:</p>
<ul>
{{if checkFlag . 1}}
<li>Discord Employee</li>
{{end}}
{{if checkFlag . 2}}
<li>Discord Partner</li>
{{end}}
{{if checkFlag . 4}}
<li>Hype Squad Events</li>
{{end}}
{{if checkFlag . 8}}
<li>Bug Hunter Level 1</li>
{{end}}
{{if checkFlag . 64}}
<li>House Bravery</li>
{{end}}
{{if checkFlag . 128}}
<li>House Brilliance</li>
{{end}}
{{if checkFlag . 256}}
<li>House Balance</li>
{{end}}
{{if checkFlag . 512}}
<li>Early Supporter</li>
{{end}}
{{if checkFlag . 1024}}
<li>Team User</li>
{{end}}
{{if checkFlag . 4096}}
<li>System</li>
{{end}}
{{if checkFlag . 16384}}
<li>Bug Hunter Level 2</li>
{{end}}
{{if checkFlag . 65536}}
<li>Verified Bot</li>
{{end}}
{{if checkFlag . 131072}}
<li>Verified Bot Developer</li>
{{end}}
{{if checkFlag . 262144}}
<li>Discord Certified Moderator</li>
{{end}}
</ul>
<p>My Flags:</p>
<ul>
{{if checkFlag . 1}}
<li>Discord Employee</li>
{{end}}
{{if checkFlag . 2}}
<li>Discord Partner</li>
{{end}}
{{if checkFlag . 4}}
<li>Hype Squad Events</li>
{{end}}
{{if checkFlag . 8}}
<li>Bug Hunter Level 1</li>
{{end}}
{{if checkFlag . 64}}
<li>House Bravery</li>
{{end}}
{{if checkFlag . 128}}
<li>House Brilliance</li>
{{end}}
{{if checkFlag . 256}}
<li>House Balance</li>
{{end}}
{{if checkFlag . 512}}
<li>Early Supporter</li>
{{end}}
{{if checkFlag . 1024}}
<li>Team User</li>
{{end}}
{{if checkFlag . 4096}}
<li>System</li>
{{end}}
{{if checkFlag . 16384}}
<li>Bug Hunter Level 2</li>
{{end}}
{{if checkFlag . 65536}}
<li>Verified Bot</li>
{{end}}
{{if checkFlag . 131072}}
<li>Verified Bot Developer</li>
{{end}}
{{if checkFlag . 262144}}
<li>Discord Certified Moderator</li>
{{end}}
</ul>
{{end}}
</div>
<div>
<p>Connections ({{len .Connections}}):</p>
<ul class="connected-accounts">
{{range .Connections}}
<li>
<a href="{{connectedLink .}}" target="_blank" data-is-revoked="{{.Revoked}}">
<img src="/discord/assets/icon/{{.Type}}.svg"/>
<span>{{.Name}}</span>
</a>
</li>
<li>
<a href="{{connectedLink .}}" target="_blank" data-is-revoked="{{.Revoked}}">
<img src="/discord/assets/icon/{{.Type}}.svg"/>
<span>{{.Name}}</span>
</a>
</li>
{{end}}
</ul>
</div>
@ -127,11 +128,11 @@
<p>Guilds ({{len .Guilds}}):</p>
<div class="page-content guilds">
{{range $k, $v := .Guilds}}
<div class="guild-item">
<div><img {{index $.GuildIcons $k}}/></div>
<div>{{$v.Name}}</div>
<div>@*{{$v.ID}}</div>
</div>
<div class="guild-item">
<div><img {{index $.GuildIcons $k}}/></div>
<div>{{$v.Name}}</div>
<div>@*{{$v.ID}}</div>
</div>
{{end}}
</div>
</div>

View File

@ -22,7 +22,7 @@
</style>
</head>
<body>
<h1>Gitea | Melon Tools</h1>
<h1>Gitea | <a href="/">Melon Tools</a></h1>
<div class="page-content">
<div>
<p>Select repository source:</p>
@ -31,29 +31,29 @@
<a href="?org=$me">{{.Username}} (my user account)</a>
</li>
{{range .Orgs}}
<li>
<a href="?org={{.Name}}">{{.Name}}</a>
</li>
<li>
<a href="?org={{.Name}}">{{.Name}}</a>
</li>
{{end}}
</ul>
</div>
{{if .ShowOrg}}
<div>
<p>Select repository:</p>
<ul>
{{range .Repos}}
<li>
<a href="?org={{$.SelOrg}}&repo={{.Name}}">{{$.MyOrg}}/{{.Name}}</a>
</li>
{{end}}
</ul>
</div>
<div>
<p>Select repository:</p>
<ul>
{{range .Repos}}
<li>
<a href="?org={{$.SelOrg}}&repo={{.Name}}">{{$.MyOrg}}/{{.Name}}</a>
</li>
{{end}}
</ul>
</div>
{{end}}
{{if .ShowRepo}}
<div>
<p>Repository details:</p>
<p>Go import: go get {{.SelModule}}@v0.0.0-{{.CommitTime}}-{{.CommitHash}}</p>
</div>
<div>
<p>Repository details:</p>
<p>Go import: go get {{.SelModule}}@v0.0.0-{{.CommitTime}}-{{.CommitHash}}</p>
</div>
{{end}}
</div>
</body>