Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding existing docs to the wiki #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
13 changes: 13 additions & 0 deletions docs/assets/scripts/extra_script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let logo_title = document.getElementsByClassName('md-header__topic')[0]
logo_title.className = 'md-header__button md-header__topic'

logo_title.onclick = function() {
location.href = document.location.origin;
};
logo_title.onmouseover = function(){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cant you do this with css? lol

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah was in my js file forgot about it lmao

document.documentElement.style.cursor = 'pointer';
}
logo_title.onmouseout = function(){
document.documentElement.style.cursor = 'initial';
}

17 changes: 17 additions & 0 deletions docs/assets/stylesheets/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
.md-header__topic{
margin: -0.3rem;
}

[data-md-toggle="search"]:not(:checked) ~ .md-header .md-search__form::after {
position: absolute;
top: .3rem;
right: .3rem;
display: block;
padding: .3rem .4rem;
color: var(--md-primary-bg-color);
font-size: .5rem;
border: .05rem solid var(--md-primary-bg-color--light);
border-radius: .1rem;
content: "S";
}

.container {
margin-top: 1rem;
}
Expand Down
1 change: 0 additions & 1 deletion docs/disgo/bot.md

This file was deleted.

16 changes: 16 additions & 0 deletions docs/disgo/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Full Ping Pong example

A full Ping Pong example can also be found [here](https://github.com/disgoorg/disgo/blob/master/_examples/ping_pong/example.go)

## Other examples

You can find examples [here](https://github.com/disgoorg/disgo/tree/master/_examples)

There is also a bot template with commands & db [here](https://github.com/disgoorg/bot-template)

or in these projects:

* [DisGo-Butler](https://github.com/disgoorg/disgo-butler)
* [Reddit-Discord-Bot](https://github.com/TopiSenpai/Reddit-Discord-Bot)
* [Kitsune-Bot](https://github.com/TopiSenpai/Kitsune-Bot)
* [KittyBot](https://github.com/KittyBot-Org/KittyBotGo)
17 changes: 17 additions & 0 deletions docs/disgo/features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
* Full Rest API coverage
* [Gateway](https://discord.com/developers/docs/topics/gateway)
* [Sharding](https://discord.com/developers/docs/topics/gateway#sharding)
* [HTTP Interactions](https://discord.com/developers/docs/interactions/slash-commands#receiving-an-interaction)
* [Application Commands](https://discord.com/developers/docs/interactions/application-commands)
* [Message Components](https://discord.com/developers/docs/interactions/message-components)
* [Modals](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal)
* [Stage Instance](https://discord.com/developers/docs/resources/stage-instance)
* [Guild Template](https://discord.com/developers/docs/resources/guild-template)
* [Sticker](https://discord.com/developers/docs/resources/sticker)
* [RateLimit](https://discord.com/developers/docs/topics/rate-limits)
* [Webhook](https://discord.com/developers/docs/resources/webhook)
* [OAuth2](https://discord.com/developers/docs/topics/oauth2)
* [Threads](https://discord.com/developers/docs/topics/threads)
* [Guild Scheduled Event](https://discord.com/developers/docs/resources/guild-scheduled-event)
* [Voice](https://discord.com/developers/docs/topics/voice-connections)

1 change: 0 additions & 1 deletion docs/disgo/gateway.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/disgo/getting-started.md

This file was deleted.

58 changes: 57 additions & 1 deletion docs/disgo/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,57 @@
welcome
### Installing

```sh
$ go get github.com/disgoorg/disgo
```

### Building a DisGo Instance

Build a bot client to interact with the Discord API
```go
package main

import (
"context"
"os"
"os/signal"
"syscall"

"github.com/disgoorg/disgo"
"github.com/disgoorg/disgo/bot"
"github.com/disgoorg/disgo/events"
"github.com/disgoorg/disgo/gateway"
)

func main() {
client, err := disgo.New("token",
// set gateway options
bot.WithGatewayConfigOpts(
// set enabled intents
gateway.WithIntents(
gateway.IntentGuilds,
gateway.IntentGuildMessages,
gateway.IntentDirectMessages,
),
),
// add event listeners
bot.WithEventListenerFunc(func(e *events.MessageCreate) {
// event code here
}),
)
if err != nil {
panic(err)
}
// connect to the gateway
if err = client.OpenGateway(context.TODO()); err != nil {
panic(err)
}

s := make(chan os.Signal, 1)
signal.Notify(s, syscall.SIGINT, syscall.SIGTERM)
<-s
}
```

### Logging

DisGo uses [slog](https://pkg.go.dev/log/slog) for logging.
Loading