change localhost to http
This commit is contained in:
parent
55cdbaf196
commit
f5768998b9
10 changed files with 11 additions and 98 deletions
11
.github/dependabot.yml
vendored
11
.github/dependabot.yml
vendored
|
@ -1,11 +0,0 @@
|
||||||
# To get started with Dependabot version updates, you'll need to specify which
|
|
||||||
# package ecosystems to update and where the package manifests are located.
|
|
||||||
# Please see the documentation for all configuration options:
|
|
||||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "cargo" # See documentation for possible values
|
|
||||||
directory: "/" # Location of package manifests
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
|
@ -1,22 +0,0 @@
|
||||||
name: Rust
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "master" ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ "master" ]
|
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Build
|
|
||||||
run: cargo build --release --verbose
|
|
||||||
- name: Run tests
|
|
||||||
run: cargo test --verbose
|
|
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
|
@ -1,8 +0,0 @@
|
||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
13
.idea/ZMP-bot.iml
generated
13
.idea/ZMP-bot.iml
generated
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="EMPTY_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/commands/T/src" isTestSource="false" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/src/commands/T/target" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
11
.idea/inspectionProfiles/Project_Default.xml
generated
11
.idea/inspectionProfiles/Project_Default.xml
generated
|
@ -1,11 +0,0 @@
|
||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<profile version="1.0">
|
|
||||||
<option name="myName" value="Project Default" />
|
|
||||||
<inspection_tool class="RsMainFunctionNotFound" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
||||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
|
||||||
<option name="processCode" value="true" />
|
|
||||||
<option name="processLiterals" value="true" />
|
|
||||||
<option name="processComments" value="true" />
|
|
||||||
</inspection_tool>
|
|
||||||
</profile>
|
|
||||||
</component>
|
|
7
.idea/misc.xml
generated
7
.idea/misc.xml
generated
|
@ -1,7 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="DiscordProjectSettings">
|
|
||||||
<option name="show" value="ASK" />
|
|
||||||
<option name="description" value="" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/../zmp-bot/.idea/ZMP-bot.iml" filepath="$PROJECT_DIR$/../zmp-bot/.idea/ZMP-bot.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
7
.idea/vcs.xml
generated
7
.idea/vcs.xml
generated
|
@ -1,7 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
<mapping directory="$PROJECT_DIR$/../zmp-bot" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -32,7 +32,7 @@ pub(crate) enum ListType {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn fetch_all(client: &Client) -> Result<Vec<Bot>, Error> {
|
pub(crate) async fn fetch_all(client: &Client) -> Result<Vec<Bot>, Error> {
|
||||||
let url = "https://localhost:6969/list";
|
let url = "http://localhost:6969/list";
|
||||||
let response: Vec<Bot> = client
|
let response: Vec<Bot> = client
|
||||||
.get(url)
|
.get(url)
|
||||||
.send()
|
.send()
|
||||||
|
|
20
src/error.rs
20
src/error.rs
|
@ -13,9 +13,9 @@ macro_rules! reply_fail_handler {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
SqlxError(sqlx::Error),
|
Sqlx(sqlx::Error),
|
||||||
ApiError(reqwest::Error),
|
Api(reqwest::Error),
|
||||||
SerenityError(serenity::Error),
|
Serenity(serenity::Error),
|
||||||
OnCooldown(std::time::Duration),
|
OnCooldown(std::time::Duration),
|
||||||
Other(String),
|
Other(String),
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,9 @@ pub enum Error {
|
||||||
impl Display for Error {
|
impl Display for Error {
|
||||||
fn fmt(&self, f: &mut Formatter) -> FmtResult {
|
fn fmt(&self, f: &mut Formatter) -> FmtResult {
|
||||||
match self {
|
match self {
|
||||||
Error::SqlxError(e) => write!(f, "SQLx Error: {}", e),
|
Error::Sqlx(e) => write!(f, "SQLx Error: {}", e),
|
||||||
Error::ApiError(e) => write!(f, "HTTPS Error:\n{}", e),
|
Error::Api(e) => write!(f, "HTTPS Error:\n{}", e),
|
||||||
Error::SerenityError(e) => write!(f, "Discord Error:\n {}", e),
|
Error::Serenity(e) => write!(f, "Discord Error:\n {}", e),
|
||||||
Error::OnCooldown(d) => write!(
|
Error::OnCooldown(d) => write!(
|
||||||
f,
|
f,
|
||||||
"This command is on cooldown. {}s remaining.",
|
"This command is on cooldown. {}s remaining.",
|
||||||
|
@ -38,23 +38,23 @@ impl Display for Error {
|
||||||
|
|
||||||
impl From<sqlx::Error> for Error {
|
impl From<sqlx::Error> for Error {
|
||||||
fn from(error: sqlx::Error) -> Self {
|
fn from(error: sqlx::Error) -> Self {
|
||||||
Error::SqlxError(error)
|
Error::Sqlx(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<reqwest::Error> for Error {
|
impl From<reqwest::Error> for Error {
|
||||||
fn from(error: reqwest::Error) -> Self {
|
fn from(error: reqwest::Error) -> Self {
|
||||||
Error::ApiError(error)
|
Error::Api(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<serenity::Error> for Error {
|
impl From<serenity::Error> for Error {
|
||||||
fn from(error: serenity::Error) -> Self {
|
fn from(error: serenity::Error) -> Self {
|
||||||
Error::SerenityError(error)
|
Error::Serenity(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn handle_error<'a>(error: FrameworkError<'a, Data, Error>) {
|
pub(crate) async fn handle_error(error: FrameworkError<'_, Data, Error>) {
|
||||||
match error {
|
match error {
|
||||||
FrameworkError::Command { error, ctx, .. } => {
|
FrameworkError::Command { error, ctx, .. } => {
|
||||||
reply_fail_handler!(ctx.send(
|
reply_fail_handler!(ctx.send(
|
||||||
|
|
Loading…
Add table
Reference in a new issue