mirror of
https://github.com/dsec-hub/dsec-discord-bot.git
synced 2026-09-22 07:44:26 +00:00
added README
This commit is contained in:
parent
cbd022a427
commit
36fc57a381
2 changed files with 31 additions and 39 deletions
31
README.md
Normal file
31
README.md
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
# DSEC Discord Bot
|
||||||
|
|
||||||
|
Deakin Software Engineering Club Discord Bot project. To encourage students to learn Rust and how to work in a practical and collaborative project.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
To be updated
|
||||||
|
|
||||||
|
## Rules
|
||||||
|
|
||||||
|
To be updated
|
||||||
|
|
||||||
|
## To-do
|
||||||
|
|
||||||
|
To be Updated
|
||||||
|
|
||||||
|
## Information
|
||||||
|
|
||||||
|
### Why Rust?
|
||||||
|
|
||||||
|
This is a good opportunity for students at Deakin to learn Rust.
|
||||||
|
|
||||||
|
Rust is memory safe yet performant, making it the ideal programming language for systems programming. At Deakin, Software Engineering, Computer Science and IT students mostly touch high level languages such as Python, C# and low level languages such as C++.
|
||||||
|
|
||||||
|
More and more developer tools are being written in Rust, including Rolldown, Rspack, Tauri, SWC and many more (I'm a web developer, I'm only aware of these tools written in Rust).
|
||||||
|
|
||||||
|
Rust has its own unique concepts and challenges such as the ownership model and the borrow checker. Its strict rules help prevent programming errors such as data races and memory leaks. The strict rules also help students learn how to think about writing efficient code coming from high level languages.
|
||||||
|
|
||||||
|
## Contributions
|
||||||
|
|
||||||
|
[Ryan](https://github.com/liyunze-coding)
|
||||||
39
commands.txt
39
commands.txt
|
|
@ -1,39 +0,0 @@
|
||||||
use poise::{CreateReply, ReplyHandle};
|
|
||||||
use serenity::all::EditMessage;
|
|
||||||
|
|
||||||
use crate::{Context, Error};
|
|
||||||
use std::time::Instant;
|
|
||||||
|
|
||||||
/// Show this help menu
|
|
||||||
#[poise::command(track_edits, slash_command)]
|
|
||||||
pub async fn help(
|
|
||||||
ctx: Context<'_>,
|
|
||||||
#[description = "Specific command to show help about"]
|
|
||||||
#[autocomplete = "poise::builtins::autocomplete_command"]
|
|
||||||
command: Option<String>,
|
|
||||||
) -> Result<(), Error> {
|
|
||||||
poise::builtins::help(
|
|
||||||
ctx,
|
|
||||||
command.as_deref(),
|
|
||||||
poise::builtins::HelpConfiguration {
|
|
||||||
extra_text_at_bottom: "This is an example bot made to showcase features of my custom Discord bot framework",
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Ping the bot
|
|
||||||
#[poise::command(slash_command)]
|
|
||||||
pub async fn ping(ctx: Context<'_>) -> Result<(), Error> {
|
|
||||||
let start = Instant::now();
|
|
||||||
|
|
||||||
let msg = ctx.say("Pinging... ").await?;
|
|
||||||
|
|
||||||
let elapsed_ms = start.elapsed().as_millis();
|
|
||||||
|
|
||||||
let new_msg = CreateReply::content(msg, format!("Pong!\nLatency: {} ms", elapsed_ms));
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue