Skip to content

Commit

Permalink
Merge pull request #116 from DisgoOrg/exclude-snowflake-type
Browse files Browse the repository at this point in the history
move snowflake type into new repo
  • Loading branch information
topi314 authored Jan 24, 2022
2 parents 58f4351 + 96e068e commit e001654
Show file tree
Hide file tree
Showing 154 changed files with 1,894 additions and 1,804 deletions.
3 changes: 2 additions & 1 deletion _examples/application_commands/gateway/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/DisgoOrg/disgo/core/bot"
"github.com/DisgoOrg/disgo/core/events"
"github.com/DisgoOrg/snowflake"

"github.com/DisgoOrg/disgo/core"
"github.com/DisgoOrg/disgo/discord"
Expand All @@ -18,7 +19,7 @@ import (

var (
token = os.Getenv("disgo_token")
guildID = discord.Snowflake(os.Getenv("disgo_guild_id"))
guildID = snowflake.GetSnowflakeEnv("disgo_guild_id")

commands = []discord.ApplicationCommandCreate{
discord.SlashCommandCreate{
Expand Down
1 change: 1 addition & 0 deletions _examples/application_commands/gateway/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ replace github.com/DisgoOrg/disgo => ../../../
require (
github.com/DisgoOrg/disgo v0.5.6
github.com/DisgoOrg/log v1.1.2
github.com/DisgoOrg/snowflake v1.0.1
)

require (
Expand Down
2 changes: 2 additions & 0 deletions _examples/application_commands/gateway/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
3 changes: 2 additions & 1 deletion _examples/application_commands/http/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/DisgoOrg/disgo/core/bot"
"github.com/DisgoOrg/disgo/core/events"
"github.com/DisgoOrg/snowflake"

"github.com/DisgoOrg/disgo/discord"
"github.com/DisgoOrg/disgo/httpserver"
Expand All @@ -18,7 +19,7 @@ import (
var (
token = os.Getenv("disgo_token")
publicKey = os.Getenv("disgo_public_key")
guildID = discord.Snowflake(os.Getenv("disgo_guild_id"))
guildID = snowflake.GetSnowflakeEnv("disgo_guild_id")

commands = []discord.ApplicationCommandCreate{
discord.SlashCommandCreate{
Expand Down
1 change: 1 addition & 0 deletions _examples/application_commands/http/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ replace github.com/DisgoOrg/disgo => ../../../
require (
github.com/DisgoOrg/disgo v0.5.6
github.com/DisgoOrg/log v1.1.2
github.com/DisgoOrg/snowflake v1.0.1
)

require (
Expand Down
2 changes: 2 additions & 0 deletions _examples/application_commands/http/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
1 change: 1 addition & 0 deletions _examples/components/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
)

require (
github.com/DisgoOrg/snowflake v1.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions _examples/components/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
1 change: 1 addition & 0 deletions _examples/guild_scheduled_events/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
)

require (
github.com/DisgoOrg/snowflake v1.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions _examples/guild_scheduled_events/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
1 change: 1 addition & 0 deletions _examples/message_collector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
)

require (
github.com/DisgoOrg/snowflake v1.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions _examples/message_collector/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
3 changes: 2 additions & 1 deletion _examples/oauth2/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ import (
"github.com/DisgoOrg/disgo/oauth2"
"github.com/DisgoOrg/disgo/rest"
"github.com/DisgoOrg/log"
"github.com/DisgoOrg/snowflake"
)

var (
letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
clientID = discord.Snowflake(os.Getenv("client_id"))
clientID = snowflake.GetSnowflakeEnv("client_id")
clientSecret = os.Getenv("client_secret")
baseURL = os.Getenv("base_url")
logger = log.Default()
Expand Down
1 change: 1 addition & 0 deletions _examples/oauth2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ replace github.com/DisgoOrg/disgo => ../../
require (
github.com/DisgoOrg/disgo v0.5.6
github.com/DisgoOrg/log v1.1.2
github.com/DisgoOrg/snowflake v1.0.1
)

require (
Expand Down
2 changes: 2 additions & 0 deletions _examples/oauth2/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
1 change: 1 addition & 0 deletions _examples/ping_pong/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
)

require (
github.com/DisgoOrg/snowflake v1.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions _examples/ping_pong/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
1 change: 1 addition & 0 deletions _examples/sharding/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
)

require (
github.com/DisgoOrg/snowflake v1.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions _examples/sharding/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
7 changes: 4 additions & 3 deletions _examples/test/examplebot.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/DisgoOrg/disgo/gateway"
"github.com/DisgoOrg/disgo/info"
"github.com/DisgoOrg/log"
"github.com/DisgoOrg/snowflake"
)

const (
Expand All @@ -23,9 +24,9 @@ const (

var (
token = os.Getenv("disgo_token")
guildID = discord.Snowflake(os.Getenv("disgo_test_guild_id"))
adminRoleID = discord.Snowflake(os.Getenv("disgo_admin_role_id"))
testRoleID = discord.Snowflake(os.Getenv("disgo_test_role_id"))
guildID = snowflake.GetSnowflakeEnv("disgo_test_guild_id")
adminRoleID = snowflake.GetSnowflakeEnv("disgo_admin_role_id")
testRoleID = snowflake.GetSnowflakeEnv("disgo_test_role_id")

//go:embed gopher.png
gopher []byte
Expand Down
1 change: 1 addition & 0 deletions _examples/test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ replace github.com/DisgoOrg/disgo => ../../
require (
github.com/DisgoOrg/disgo v0.5.6
github.com/DisgoOrg/log v1.1.2
github.com/DisgoOrg/snowflake v1.0.1
github.com/PaesslerAG/gval v1.1.1
)

Expand Down
2 changes: 2 additions & 0 deletions _examples/test/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/PaesslerAG/gval v1.1.1 h1:4d7pprU9876+m3rc08X33UjGip8oV1kkm8Gh5GBuTss=
github.com/PaesslerAG/gval v1.1.1/go.mod h1:Fa8gfkCmUsELXgayr8sfL/sw+VzCVoa03dcOcR/if2w=
github.com/PaesslerAG/jsonpath v0.1.0 h1:gADYeifvlqK3R3i2cR5B4DGgxLXIPb3TRTH1mGi0jPI=
Expand Down
2 changes: 1 addition & 1 deletion _examples/threads/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

var (
token = os.Getenv("token")
//guildID = discord.Snowflake(os.Getenv("guild_id"))
//guildID = snowflake.Snowflake(os.Getenv("guild_id"))
)

func main() {
Expand Down
1 change: 1 addition & 0 deletions _examples/threads/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
)

require (
github.com/DisgoOrg/snowflake v1.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions _examples/threads/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
3 changes: 2 additions & 1 deletion _examples/webhook/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import (
"github.com/DisgoOrg/disgo/rest"
"github.com/DisgoOrg/disgo/webhook"
"github.com/DisgoOrg/log"
"github.com/DisgoOrg/snowflake"
)

var (
webhookID = discord.Snowflake(os.Getenv("webhook_id"))
webhookID = snowflake.GetSnowflakeEnv("webhook_id")
webhookToken = os.Getenv("webhook_token")
)

Expand Down
1 change: 1 addition & 0 deletions _examples/webhook/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ replace github.com/DisgoOrg/disgo => ../../
require (
github.com/DisgoOrg/disgo v0.5.6
github.com/DisgoOrg/log v1.1.2
github.com/DisgoOrg/snowflake v1.0.1
)

require (
Expand Down
5 changes: 2 additions & 3 deletions _examples/webhook/go.sum
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
github.com/DisgoOrg/log v1.1.2 h1:tGJS4jaH1PyjPRHybHp8WpYJ/4fR3fYWT4Mv1PoDGBM=
github.com/DisgoOrg/log v1.1.2/go.mod h1:tSMofXaNhQNvzLRoL4tAiCG9yGY1ES5DLvduh7e9GRU=
github.com/DisgoOrg/snowflake v1.0.1 h1:+UKgfjOnj2KBj/20tWKFNzhbo9awzThkY12ZaOQzaSg=
github.com/DisgoOrg/snowflake v1.0.1/go.mod h1:jIQVlVmElm2OGt6v52ITf/71ODaU09chUCflxt8+3yM=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand All @@ -16,7 +16,6 @@ github.com/sasha-s/go-csync v0.0.0-20210812194225-61421b77c44b/go.mod h1:/pA7k3z
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
13 changes: 7 additions & 6 deletions core/application_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package core
import (
"github.com/DisgoOrg/disgo/discord"
"github.com/DisgoOrg/disgo/rest"
"github.com/DisgoOrg/snowflake"
)

type ApplicationCommand interface {
Expand Down Expand Up @@ -55,7 +56,7 @@ func (c *SlashCommand) Update(commandUpdate discord.SlashCommandUpdate, opts ...
}

// SetPermissions sets the ApplicationCommandPermissions for a specific Guild. this overrides all existing ApplicationCommandPermission(s). thx discord for that
func (c *SlashCommand) SetPermissions(guildID discord.Snowflake, commandPermissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
func (c *SlashCommand) SetPermissions(guildID snowflake.Snowflake, commandPermissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
permissions, err := c.Bot.RestServices.ApplicationService().SetGuildCommandPermissions(c.Bot.ApplicationID, guildID, c.ID(), commandPermissions, opts...)
if err != nil {
return nil, err
Expand All @@ -64,7 +65,7 @@ func (c *SlashCommand) SetPermissions(guildID discord.Snowflake, commandPermissi
}

// GetPermissions fetched the ApplicationCommandPermissions for a specific Guild from discord
func (c *SlashCommand) GetPermissions(guildID discord.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
func (c *SlashCommand) GetPermissions(guildID snowflake.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
permissions, err := c.Bot.RestServices.ApplicationService().GetGuildCommandPermissions(c.Bot.ApplicationID, guildID, c.ID(), opts...)
if err != nil {
return nil, err
Expand Down Expand Up @@ -123,7 +124,7 @@ func (c *UserCommand) Update(commandUpdate discord.UserCommandUpdate, opts ...re
}

// SetPermissions sets the ApplicationCommandPermissions for a specific Guild. this overrides all existing ApplicationCommandPermission(s). thx discord for that
func (c *UserCommand) SetPermissions(guildID discord.Snowflake, commandPermissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
func (c *UserCommand) SetPermissions(guildID snowflake.Snowflake, commandPermissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
permissions, err := c.Bot.RestServices.ApplicationService().SetGuildCommandPermissions(c.Bot.ApplicationID, guildID, c.ID(), commandPermissions, opts...)
if err != nil {
return nil, err
Expand All @@ -132,7 +133,7 @@ func (c *UserCommand) SetPermissions(guildID discord.Snowflake, commandPermissio
}

// GetPermissions fetched the ApplicationCommandPermissions for a specific Guild from discord
func (c *UserCommand) GetPermissions(guildID discord.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
func (c *UserCommand) GetPermissions(guildID snowflake.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
permissions, err := c.Bot.RestServices.ApplicationService().GetGuildCommandPermissions(c.Bot.ApplicationID, guildID, c.ID(), opts...)
if err != nil {
return nil, err
Expand Down Expand Up @@ -191,7 +192,7 @@ func (c *MessageCommand) Update(commandUpdate discord.MessageCommandUpdate, opts
}

// SetPermissions sets the ApplicationCommandPermissions for a specific Guild. this overrides all existing ApplicationCommandPermission(s). thx discord for that
func (c *MessageCommand) SetPermissions(guildID discord.Snowflake, commandPermissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
func (c *MessageCommand) SetPermissions(guildID snowflake.Snowflake, commandPermissions []discord.ApplicationCommandPermission, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
permissions, err := c.Bot.RestServices.ApplicationService().SetGuildCommandPermissions(c.Bot.ApplicationID, guildID, c.ID(), commandPermissions, opts...)
if err != nil {
return nil, err
Expand All @@ -200,7 +201,7 @@ func (c *MessageCommand) SetPermissions(guildID discord.Snowflake, commandPermis
}

// GetPermissions fetched the ApplicationCommandPermissions for a specific Guild from discord
func (c *MessageCommand) GetPermissions(guildID discord.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
func (c *MessageCommand) GetPermissions(guildID snowflake.Snowflake, opts ...rest.RequestOpt) (*ApplicationCommandPermissions, error) {
permissions, err := c.Bot.RestServices.ApplicationService().GetGuildCommandPermissions(c.Bot.ApplicationID, guildID, c.ID(), opts...)
if err != nil {
return nil, err
Expand Down
19 changes: 11 additions & 8 deletions core/application_command_interaction.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package core

import "github.com/DisgoOrg/disgo/discord"
import (
"github.com/DisgoOrg/disgo/discord"
"github.com/DisgoOrg/snowflake"
)

type ApplicationCommandInteractionFilter func(interaction *ApplicationCommandInteraction) bool

Expand Down Expand Up @@ -53,10 +56,10 @@ func (i SlashCommandInteractionData) CommandPath() string {

// SlashCommandResolved contains resolved mention data for SlashCommand(s)
type SlashCommandResolved struct {
Users map[discord.Snowflake]*User
Members map[discord.Snowflake]*Member
Roles map[discord.Snowflake]*Role
Channels map[discord.Snowflake]Channel
Users map[snowflake.Snowflake]*User
Members map[snowflake.Snowflake]*Member
Roles map[snowflake.Snowflake]*Role
Channels map[snowflake.Snowflake]Channel
}

type UserCommandInteractionData struct {
Expand All @@ -73,8 +76,8 @@ func (i *UserCommandInteractionData) TargetMember() *Member {
}

type UserCommandResolved struct {
Users map[discord.Snowflake]*User
Members map[discord.Snowflake]*Member
Users map[snowflake.Snowflake]*User
Members map[snowflake.Snowflake]*Member
}

type MessageCommandInteractionData struct {
Expand All @@ -87,5 +90,5 @@ func (i *MessageCommandInteractionData) TargetMessage() *Message {
}

type MessageCommandResolved struct {
Messages map[discord.Snowflake]*Message
Messages map[snowflake.Snowflake]*Message
}
Loading

0 comments on commit e001654

Please sign in to comment.