Skip to content

Commit

Permalink
Merge pull request #3 from AZMindroma/main
Browse files Browse the repository at this point in the history
Updated README.md and updated bot developer's name
  • Loading branch information
Inspirateur authored Oct 31, 2024
2 parents 04fbd73 + f902c60 commit 22cc0d7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
# wordy
This is the new and improved word cloud discord bot !
This is the new and improved word cloud Discord bot!

As opposed to the previous Python version, Wordy starts processing the messages as soon as it joins the server and it's much faster with it !
As opposed to the previous Python version, Wordy starts processing the messages as soon as it joins a server and is much faster at doing so!
It also automatically continues to process new messages as they are sent.

*Related Blog article: https://teo-orthlieb.github.io/blog/user-word-cloud/*
*Related blog article: https://teo-orthlieb.github.io/blog/user-word-cloud/*

## How to run it
The discord registration step is the same for all bot that you run yourself.
## Self-hosting guide
The Discord Application creation step is usually the same for all bots that you self-host.

### Register Discord Application
- go to https://discordapp.com/developers/applications/ create your app
- add a User Bot to it and paste its Token in `token.txt`
- enable `SERVER MEMBERS INTENT` and `MESSAGE CONTENT INTENT` in the bot tab
- invite the bot with `https://discord.com/api/oauth2/authorize?client_id=CLIENT_ID&permissions=0&scope=bot%20applications.commands` replace `CLIENT_ID` with the Client ID of your app
### Create a Discord Application
- Go to https://discord.com/developers/applications/ and create your app
- Add a bot to it and copy its token. You will need it later!
- Enable `PRESENCE INTENT`, `SERVER MEMBERS INTENT` and `MESSAGE CONTENT INTENT` in the bot tab
- Invite the bot with `https://discord.com/oauth2/authorize?client_id=CLIENT_ID&permissions=101376&integration_type=0&scope=bot+applications.commands` and replace `CLIENT_ID` with the Client ID of your app (which you may find under the OAuth2 tab)

**Note:** The OAuth2 link includes following permissions: View Channels, Send Messages, Read Message History (to load messages sent before the bot joined), Attach Files (to send the word cloud image)

### Run it
- Clone the project wherever you want
- add the `token.txt` file at the root of the project
- Install the necessary tools to compile Rust with https://rustup.rs/
- With a terminal positionned at the root of the project, run `cargo build --release` to build the project.
*Note: this will take a while because it's the first build you do, subsequent builds will be much faster*
- Add the `token.txt` file at the root of the project (the root of the project is not inside the src folder, instead the folder with the Cargo files which includes the assets and src folder) and paste the token you copied before into this file (without anything else)
- Install the necessary tools to compile Rust programs by visiting https://rustup.rs/ and copypasting the command into your terminal and following its steps. A standard installation works to build this project.
- With a terminal positioned at the root of the project, run `cargo build --release` to build the project.
*Note: This will take a while because it's the first build you do, subsequent builds will be much faster.*
- Run the project with `cargo run --release`

[demo incoming]
### Generate your word cloud
- The bot will load existing messages from the channels it is able to read from.
- Once the messages are loaded (it also works beforehand, which will however not give an extensive result), you can run the bot's slash command `/cloud` to display your word cloud!

#### This is how a word cloud might look like:
![Demonstration word cloud](demo.png)
File renamed without changes
4 changes: 2 additions & 2 deletions src/wordy_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Wordy {
ctx.http
.answer(
&command,
"Made with ❤️ by Inspi#8989\n
"Made with ❤️ by inspirateur\n
Repository: <https://github.com/Inspirateur/wordy>",
vec![],
)
Expand All @@ -83,7 +83,7 @@ impl Wordy {
pub async fn register_commands(&self, http: Arc<Http>, guild_id: GuildId) {
trace!(target: "wordy", "Registering slash commands for Guild {}", guild_id);
if let Err(why) = GuildId::set_commands(guild_id, http, vec![
CreateCommand::new("cloud").description("Discover the word cloud that defines you !"),
CreateCommand::new("cloud").description("Discover the word cloud that defines you!"),
CreateCommand::new("emojis").description("Recent emoji usage stats."),
CreateCommand::new("info").description("Information about this bot.")
]).await {
Expand Down

0 comments on commit 22cc0d7

Please sign in to comment.