Actually put this in a remote
This commit is contained in:
commit
839f0420b6
|
|
@ -0,0 +1,2 @@
|
||||||
|
/target
|
||||||
|
*.db
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
|
<data-source source="LOCAL" name="badgey" uuid="ed447429-51cc-4bc2-8e9e-3be2bfce8c31">
|
||||||
|
<driver-ref>sqlite.xerial</driver-ref>
|
||||||
|
<synchronize>true</synchronize>
|
||||||
|
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
|
||||||
|
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/manifold.db</jdbc-url>
|
||||||
|
<working-dir>$ProjectFileDir$</working-dir>
|
||||||
|
</data-source>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/badgey.iml" filepath="$PROJECT_DIR$/.idea/badgey.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,20 @@
|
||||||
|
[package]
|
||||||
|
name = "badgey"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
built = { version = "0.6.0", features = ["git2", "semver", "chrono"] }
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
built = { version = "0.6.0", features = ["git2", "semver", "chrono"] }
|
||||||
|
clap = { version = "4.3.23", features = ["cargo"] }
|
||||||
|
diesel = { version = "2.1.0", features = ["sqlite", "r2d2", "chrono"] }
|
||||||
|
diesel_migrations = "2.1.0"
|
||||||
|
env_logger = "0.10.0"
|
||||||
|
log = "0.4.20"
|
||||||
|
manifold = { path = "/home/xyon/Workspace/manifold" }
|
||||||
|
poise = "0.5.5"
|
||||||
|
tokio = { version = "1.16.1", features = ["sync", "macros", "rt-multi-thread"] }
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
extern crate built;
|
||||||
|
fn main() {
|
||||||
|
built::write_built_file().expect("Failed to collate build info");
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"ProductionBotPrefix": ".",
|
||||||
|
"ProductionWeatherApiKey": "70aacb9af931438a957215406211210",
|
||||||
|
"ProductionWeatherBaseUrl": "https://api.weatherapi.com/v1",
|
||||||
|
"ProductionLogChannel": "1143479696886087801",
|
||||||
|
"ProductionBotNickname": "Badgey"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
-- This file should undo anything in `up.sql`
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
-- Your SQL goes here
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
use manifold::{ManifoldContext, ManifoldData};
|
||||||
|
use manifold::error::{ManifoldError, ManifoldResult};
|
||||||
|
use poise::Command;
|
||||||
|
|
||||||
|
pub fn collect_commands() -> Vec<Command<ManifoldData, ManifoldError>> {
|
||||||
|
commands().into_iter().collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn commands() -> [Command<ManifoldData, ManifoldError>; 0] {
|
||||||
|
[]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
use std::io::stdout;
|
||||||
|
use clap::ArgMatches;
|
||||||
|
use diesel::sqlite::Sqlite;
|
||||||
|
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
|
||||||
|
use poise::serenity_prelude as serenity;
|
||||||
|
|
||||||
|
use manifold::config::ManifoldConfig;
|
||||||
|
use manifold::{ManifoldDatabase, ManifoldDatabasePool};
|
||||||
|
use poise::serenity_prelude::GatewayIntents;
|
||||||
|
|
||||||
|
mod commands;
|
||||||
|
|
||||||
|
pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations");
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
pub async fn run(arguments: ArgMatches) {
|
||||||
|
let mut client = match manifold::prepare_client(arguments, GatewayIntents::all(), commands::collect_commands()).await {
|
||||||
|
Ok(c) => c,
|
||||||
|
Err(e) => {
|
||||||
|
error!("Error preparing client; {:?}", e);
|
||||||
|
panic!("Error preparing client!");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
client.build().await.unwrap().start().await;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn apply_migrations(conn: &mut impl MigrationHarness<Sqlite>) {
|
||||||
|
|
||||||
|
conn.run_pending_migrations(MIGRATIONS)
|
||||||
|
.expect("An error occurred applying migrations.");
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
#![feature(string_remove_matches)]
|
||||||
|
|
||||||
|
#[macro_use] extern crate diesel;
|
||||||
|
#[macro_use] extern crate diesel_migrations;
|
||||||
|
#[macro_use] extern crate log;
|
||||||
|
|
||||||
|
pub mod badgey;
|
||||||
|
|
||||||
|
use clap::{Command, Arg, crate_version};
|
||||||
|
|
||||||
|
// Retrieve build info from output file
|
||||||
|
pub mod built_info {
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/built.rs"));
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
|
||||||
|
env_logger::init();
|
||||||
|
|
||||||
|
let git_info: String = built_info::GIT_VERSION.unwrap_or("unknown").to_string();
|
||||||
|
|
||||||
|
info!("Badgey Bot version {}({}) starting up...", built_info::PKG_VERSION, git_info);
|
||||||
|
|
||||||
|
let matches = Command::new("Badgey Bot, Discord Edition")
|
||||||
|
.version(crate_version!())
|
||||||
|
.author("Xyon <xyon@orbiter-radio.uk>")
|
||||||
|
.about("General-Purpose bot for the Escape Pod 14 Discord Server.")
|
||||||
|
.arg(Arg::new("config-file")
|
||||||
|
.short('c')
|
||||||
|
.long("config-file")
|
||||||
|
.value_name("FILE")
|
||||||
|
.default_value("badgey.json")
|
||||||
|
.help("Path to the config file to use, relative to the 'config/' subdirectory beneath the binary path. Defaults to config/badgey.json."))
|
||||||
|
.arg(Arg::new("environment")
|
||||||
|
.short('e')
|
||||||
|
.long("environment")
|
||||||
|
.value_name("ENV")
|
||||||
|
.default_value("Production")
|
||||||
|
.help("Bot environment to use. Determines which config settings are read. Defaults to Production."))
|
||||||
|
.arg(Arg::new("make-config")
|
||||||
|
.short('M')
|
||||||
|
.long("make-config")
|
||||||
|
.help("Generates a default config file, to get started. This will be just enough for the bot to run, but some key settings will be incorrect."))
|
||||||
|
.get_matches();
|
||||||
|
|
||||||
|
badgey::run(matches);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
[bot startup]
|
||||||
|
**B A D G E Y** program initialising. Loading targets from memory.
|
||||||
|
Badgey lives again! Nothing can kill Badgey! Badgey is indestructible!
|
||||||
|
Reticulating splines....
|
||||||
|
[help footer]
|
||||||
|
Badgey wants you to know he has nothing but love for you. Today.
|
||||||
|
Badgey's patience is boundless! He wishes you nothing but good fortune on your voyage of discovery.
|
||||||
|
Badgey wants to know why you're asking about his internals.
|
||||||
|
Badgey has recorded this request for information about his innermost structures. Badgey will remember.
|
||||||
|
Badgey knows where you sleep, you know. He just wanted you to remember that.
|
||||||
|
[weather card footer]
|
||||||
|
Badgey Weather brought to you in association with AstroGlide, for the smoothest operations you'll ever perform.
|
||||||
|
This weather broadcast and all which preceded it are entirely fictional. Badgey takes no responsibility for any harm caused by believing otherwise.
|
||||||
|
Badgey Weather proudly powered by one lawnmower engine and a 93 year old veteran who just won't quit.
|
||||||
|
The Badgey Weather service operates on your donations and the tears of the unvaccinated.
|
||||||
|
Weather by Badgey. Not the reporting. The actual weather. I can do what I want.
|
||||||
|
This report will self destruct in five seconds.
|
||||||
|
Any information contained within the above weather report is not safe for human consumption. In case of contact with eyes, please consult a medical professional.
|
||||||
|
I think your warp core is leaking.
|
||||||
|
Badgey tried to get this weather report approved by Starfleet, but Starfleet denies any knowledge of the existence or nonexistence of Badgey, and this made Badgey sad.
|
||||||
|
[end]
|
||||||
Loading…
Reference in New Issue