Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Multiplexer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
FreeNitori
Multiplexer
Commits
4dc38d72
Commit
4dc38d72
authored
Jul 29, 2021
by
Ophestra
Browse files
Options
Downloads
Patches
Plain Diff
extra check to reduce unnecessary error outputs
parent
f2501bd2
Branches
Branches containing commit
Tags
v1.0.13
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
context.go
+1
-1
1 addition, 1 deletion
context.go
fetch.go
+5
-0
5 additions, 0 deletions
fetch.go
with
6 additions
and
1 deletion
context.go
+
1
−
1
View file @
4dc38d72
...
...
@@ -143,7 +143,7 @@ func (context *Context) GetMember(query string) *discordgo.Member {
_
,
err
:=
strconv
.
Atoi
(
query
)
if
strings
.
HasPrefix
(
query
,
"<@"
)
&&
strings
.
HasSuffix
(
query
,
">"
)
||
err
==
nil
{
// Strip off the mention thingy
userID
:=
numericalRegex
.
ReplaceAllString
(
query
,
"
"
)
userID
:=
strings
.
TrimSuffix
(
strings
.
TrimPrefix
(
strings
.
TrimPrefix
(
query
,
"<@"
),
"!"
),
">
"
)
// Length of a real snowflake after stripping off stuff
if
len
(
userID
)
==
18
{
for
_
,
member
:=
range
context
.
Guild
.
Members
{
...
...
This diff is collapsed.
Click to expand it.
fetch.go
+
5
−
0
View file @
4dc38d72
...
...
@@ -32,6 +32,11 @@ func GetGuild(session *discordgo.Session, id string) *discordgo.Guild {
func
GetChannel
(
session
*
discordgo
.
Session
,
id
string
)
*
discordgo
.
Channel
{
var
err
error
var
channel
*
discordgo
.
Channel
if
id
==
""
{
return
nil
}
channel
,
err
=
session
.
State
.
Channel
(
id
)
if
err
!=
nil
{
// Attempt direct API fetching
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment