public
imalexnord
read
Discord-hetzner-VM
No description yet
Languages
Repository composition by tracked source files.
Python
100%
Create file
Wiki Documentation
Clone
https://nobgit.com/user/imalexnord/discord-hetzner-vm.git
ssh://[email protected]:2222/user/imalexnord/discord-hetzner-vm.git
Trace
bot.py
Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.
bot.py
on main
Author
Date
Commit
Line
Code
Alex Carrington
7 months ago
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 1
import os
import os
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 2
import asyncio
import asyncio
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 3
import sqlite3
import sqlite3
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 4
from dataclasses import dataclass
from dataclasses import dataclass
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 5
from typing import Optional, Dict, List, Tuple
from typing import Optional, Dict, List, Tuple
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 6
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 7
from dotenv import load_dotenv
from dotenv import load_dotenv
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 8
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 9
import discord
import discord
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 10
from discord import app_commands
from discord import app_commands
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 11
from discord.ext import commands
from discord.ext import commands
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 12
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 13
from hcloud import Client
from hcloud import Client
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 14
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 15
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 16
load_dotenv()
load_dotenv()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 17
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 18
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 19
HCLOUD_TOKEN = os.getenv("HCLOUD_TOKEN")
HCLOUD_TOKEN = os.getenv("HCLOUD_TOKEN")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 20
if not DISCORD_TOKEN or not HCLOUD_TOKEN:
if not DISCORD_TOKEN or not HCLOUD_TOKEN:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 21
raise RuntimeError("Missing DISCORD_TOKEN or HCLOUD_TOKEN in env")
raise RuntimeError("Missing DISCORD_TOKEN or HCLOUD_TOKEN in env")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 22
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 23
hc = Client(token=HCLOUD_TOKEN)
hc = Client(token=HCLOUD_TOKEN)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 24
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 25
DEFAULT_SERVER_TYPE = "cx23"
DEFAULT_SERVER_TYPE = "cx23"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 26
DB_PATH = "servers.db"
DB_PATH = "servers.db"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 27
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 28
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 29
def db_init() -> None:
def db_init() -> None:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 30
with sqlite3.connect(DB_PATH) as con:
with sqlite3.connect(DB_PATH) as con:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 31
cur = con.cursor()
cur = con.cursor()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 32
cur.execute(
cur.execute(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 33
"""
"""
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 34
CREATE TABLE IF NOT EXISTS server_map (
CREATE TABLE IF NOT EXISTS server_map (
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 35
discord_user_id TEXT NOT NULL,
discord_user_id TEXT NOT NULL,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 36
server_id INTEGER NOT NULL,
server_id INTEGER NOT NULL,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 37
server_name TEXT NOT NULL,
server_name TEXT NOT NULL,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 38
PRIMARY KEY(discord_user_id, server_id)
PRIMARY KEY(discord_user_id, server_id)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 39
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 40
"""
"""
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 41
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 42
cur.execute(
cur.execute(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 43
"""
"""
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 44
CREATE TABLE IF NOT EXISTS user_defaults (
CREATE TABLE IF NOT EXISTS user_defaults (
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 45
discord_user_id TEXT PRIMARY KEY,
discord_user_id TEXT PRIMARY KEY,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 46
network_id INTEGER,
network_id INTEGER,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 47
ssh_key_id INTEGER,
ssh_key_id INTEGER,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 48
firewall_id INTEGER
firewall_id INTEGER
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 49
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 50
"""
"""
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 51
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 52
con.commit()
con.commit()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 53
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 54
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 55
def db_add_server(discord_user_id: int, server_id: int, server_name: str) -> None:
def db_add_server(discord_user_id: int, server_id: int, server_name: str) -> None:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 56
with sqlite3.connect(DB_PATH) as con:
with sqlite3.connect(DB_PATH) as con:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 57
cur = con.cursor()
cur = con.cursor()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 58
cur.execute(
cur.execute(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 59
"INSERT OR REPLACE INTO server_map(discord_user_id, server_id, server_name) VALUES (?, ?, ?)",
"INSERT OR REPLACE INTO server_map(discord_user_id, server_id, server_name) VALUES (?, ?, ?)",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 60
(str(discord_user_id), int(server_id), server_name),
(str(discord_user_id), int(server_id), server_name),
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 61
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 62
con.commit()
con.commit()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 63
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 64
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 65
def db_find_server(discord_user_id: int, query: str) -> Optional[int]:
def db_find_server(discord_user_id: int, query: str) -> Optional[int]:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 66
q = (query or "").strip()
q = (query or "").strip()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 67
with sqlite3.connect(DB_PATH) as con:
with sqlite3.connect(DB_PATH) as con:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 68
cur = con.cursor()
cur = con.cursor()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 69
if q.isdigit():
if q.isdigit():
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 70
cur.execute(
cur.execute(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 71
"SELECT server_id FROM server_map WHERE discord_user_id=? AND server_id=?",
"SELECT server_id FROM server_map WHERE discord_user_id=? AND server_id=?",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 72
(str(discord_user_id), int(q)),
(str(discord_user_id), int(q)),
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 73
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 74
row = cur.fetchone()
row = cur.fetchone()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 75
return row[0] if row else None
return row[0] if row else None
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 76
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 77
cur.execute(
cur.execute(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 78
"SELECT server_id FROM server_map WHERE discord_user_id=? AND server_name=?",
"SELECT server_id FROM server_map WHERE discord_user_id=? AND server_name=?",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 79
(str(discord_user_id), q),
(str(discord_user_id), q),
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 80
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 81
row = cur.fetchone()
row = cur.fetchone()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 82
return row[0] if row else None
return row[0] if row else None
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 83
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 84
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 85
def db_get_defaults(discord_user_id: int) -> Tuple[Optional[int], Optional[int], Optional[int]]:
def db_get_defaults(discord_user_id: int) -> Tuple[Optional[int], Optional[int], Optional[int]]:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 86
with sqlite3.connect(DB_PATH) as con:
with sqlite3.connect(DB_PATH) as con:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 87
cur = con.cursor()
cur = con.cursor()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 88
cur.execute(
cur.execute(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 89
"SELECT network_id, ssh_key_id, firewall_id FROM user_defaults WHERE discord_user_id=?",
"SELECT network_id, ssh_key_id, firewall_id FROM user_defaults WHERE discord_user_id=?",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 90
(str(discord_user_id),),
(str(discord_user_id),),
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 91
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 92
row = cur.fetchone()
row = cur.fetchone()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 93
if not row:
if not row:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 94
return None, None, None
return None, None, None
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 95
return row[0], row[1], row[2]
return row[0], row[1], row[2]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 96
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 97
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 98
def db_set_defaults(
def db_set_defaults(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 99
discord_user_id: int,
discord_user_id: int,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 100
network_id: Optional[int],
network_id: Optional[int],
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 101
ssh_key_id: Optional[int],
ssh_key_id: Optional[int],
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 102
firewall_id: Optional[int],
firewall_id: Optional[int],
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 103
) -> None:
) -> None:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 104
with sqlite3.connect(DB_PATH) as con:
with sqlite3.connect(DB_PATH) as con:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 105
cur = con.cursor()
cur = con.cursor()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 106
cur.execute(
cur.execute(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 107
"INSERT OR REPLACE INTO user_defaults(discord_user_id, network_id, ssh_key_id, firewall_id) VALUES (?, ?, ?, ?)",
"INSERT OR REPLACE INTO user_defaults(discord_user_id, network_id, ssh_key_id, firewall_id) VALUES (?, ?, ?, ?)",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 108
(str(discord_user_id), network_id, ssh_key_id, firewall_id),
(str(discord_user_id), network_id, ssh_key_id, firewall_id),
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 109
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 110
con.commit()
con.commit()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 111
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 112
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 113
@dataclass
@dataclass
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 114
class HetznerCache:
class HetznerCache:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 115
locations: Dict[str, object]
locations: Dict[str, object]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 116
server_types: Dict[str, object]
server_types: Dict[str, object]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 117
images_all: Dict[str, object]
images_all: Dict[str, object]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 118
images_x86: Dict[str, object]
images_x86: Dict[str, object]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 119
networks: Dict[int, object]
networks: Dict[int, object]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 120
ssh_keys: Dict[int, object]
ssh_keys: Dict[int, object]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 121
firewalls: Dict[int, object]
firewalls: Dict[int, object]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 122
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 123
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 124
HCACHE: Optional[HetznerCache] = None
HCACHE: Optional[HetznerCache] = None
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 125
AUTO_IMAGES_X86: List[str] = []
AUTO_IMAGES_X86: List[str] = []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 126
AUTO_LOCATIONS: List[str] = []
AUTO_LOCATIONS: List[str] = []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 127
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 128
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 129
def _img_arch(img: object) -> str:
def _img_arch(img: object) -> str:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 130
arch = getattr(img, "architecture", None)
arch = getattr(img, "architecture", None)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 131
return str(arch).lower() if arch is not None else "unknown"
return str(arch).lower() if arch is not None else "unknown"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 132
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 133
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 134
def _is_x86_arch(arch: str) -> bool:
def _is_x86_arch(arch: str) -> bool:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 135
a = (arch or "").lower()
a = (arch or "").lower()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 136
return ("x86" in a) or ("amd64" in a) or ("x86_64" in a)
return ("x86" in a) or ("amd64" in a) or ("x86_64" in a)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 137
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 138
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 139
def build_cache() -> HetznerCache:
def build_cache() -> HetznerCache:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 140
locations = {l.name: l for l in hc.locations.get_all()}
locations = {l.name: l for l in hc.locations.get_all()}
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 141
server_types = {st.name: st for st in hc.server_types.get_all()}
server_types = {st.name: st for st in hc.server_types.get_all()}
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 142
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 143
images_all_list = hc.images.get_all()
images_all_list = hc.images.get_all()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 144
images_all = {im.name: im for im in images_all_list}
images_all = {im.name: im for im in images_all_list}
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 145
images_x86 = {im.name: im for im in images_all_list if _is_x86_arch(_img_arch(im))}
images_x86 = {im.name: im for im in images_all_list if _is_x86_arch(_img_arch(im))}
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 146
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 147
networks = {n.id: n for n in hc.networks.get_all()}
networks = {n.id: n for n in hc.networks.get_all()}
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 148
ssh_keys = {k.id: k for k in hc.ssh_keys.get_all()}
ssh_keys = {k.id: k for k in hc.ssh_keys.get_all()}
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 149
firewalls = {f.id: f for f in hc.firewalls.get_all()}
firewalls = {f.id: f for f in hc.firewalls.get_all()}
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 150
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 151
return HetznerCache(
return HetznerCache(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 152
locations=locations,
locations=locations,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 153
server_types=server_types,
server_types=server_types,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 154
images_all=images_all,
images_all=images_all,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 155
images_x86=images_x86,
images_x86=images_x86,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 156
networks=networks,
networks=networks,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 157
ssh_keys=ssh_keys,
ssh_keys=ssh_keys,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 158
firewalls=firewalls,
firewalls=firewalls,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 159
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 160
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 161
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 162
def cache_required() -> HetznerCache:
def cache_required() -> HetznerCache:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 163
global HCACHE
global HCACHE
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 164
if HCACHE is None:
if HCACHE is None:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 165
HCACHE = build_cache()
HCACHE = build_cache()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 166
return HCACHE
return HCACHE
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 167
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 168
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 169
def _top(items: List[str], n: int = 50) -> str:
def _top(items: List[str], n: int = 50) -> str:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 170
head = "\n".join(items[:n])
head = "\n".join(items[:n])
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 171
if len(items) <= n:
if len(items) <= n:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 172
return head
return head
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 173
return head + f"\n… (+{len(items) - n} more)"
return head + f"\n… (+{len(items) - n} more)"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 174
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 175
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 176
def pick_single_or_user_default(kind: str, items_by_id: Dict[int, object], user_default_id: Optional[int]) -> object:
def pick_single_or_user_default(kind: str, items_by_id: Dict[int, object], user_default_id: Optional[int]) -> object:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 177
if not items_by_id:
if not items_by_id:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 178
raise RuntimeError(f"No {kind} exists in Hetzner.")
raise RuntimeError(f"No {kind} exists in Hetzner.")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 179
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 180
if len(items_by_id) == 1:
if len(items_by_id) == 1:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 181
return next(iter(items_by_id.values()))
return next(iter(items_by_id.values()))
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 182
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 183
if user_default_id and user_default_id in items_by_id:
if user_default_id and user_default_id in items_by_id:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 184
return items_by_id[user_default_id]
return items_by_id[user_default_id]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 185
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 186
lines: List[str] = []
lines: List[str] = []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 187
for obj in items_by_id.values():
for obj in items_by_id.values():
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 188
nm = getattr(obj, "name", str(getattr(obj, "id", "?")))
nm = getattr(obj, "name", str(getattr(obj, "id", "?")))
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 189
oid = getattr(obj, "id", "?")
oid = getattr(obj, "id", "?")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 190
lines.append(f"- {nm} (id {oid})")
lines.append(f"- {nm} (id {oid})")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 191
lines.sort()
lines.sort()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 192
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 193
raise RuntimeError(
raise RuntimeError(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 194
f"Multiple {kind}s exist, and no default is set.\n"
f"Multiple {kind}s exist, and no default is set.\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 195
f"Use /setdefaults to choose IDs.\n\n"
f"Use /setdefaults to choose IDs.\n\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 196
f"Available {kind}s:\n" + "\n".join(lines)
f"Available {kind}s:\n" + "\n".join(lines)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 197
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 198
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 199
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 200
def cloud_init_for_app(app: str) -> str:
def cloud_init_for_app(app: str) -> str:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 201
app = (app or "").strip().lower()
app = (app or "").strip().lower()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 202
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 203
if app in ("", "none"):
if app in ("", "none"):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 204
return ""
return ""
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 205
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 206
if app == "coolify":
if app == "coolify":
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 207
return (
return (
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 208
"#cloud-config\n"
"#cloud-config\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 209
"package_update: true\n"
"package_update: true\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 210
"packages:\n"
"packages:\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 211
" - curl\n"
" - curl\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 212
"runcmd:\n"
"runcmd:\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 213
" - curl -fsSL https://get.docker.com | sh\n"
" - curl -fsSL https://get.docker.com | sh\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 214
" - curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash\n"
" - curl -fsSL https://cdn.coollabs.io/coolify/install.sh | bash\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 215
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 216
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 217
if app == "wireguard":
if app == "wireguard":
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 218
return (
return (
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 219
"#cloud-config\n"
"#cloud-config\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 220
"package_update: true\n"
"package_update: true\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 221
"packages:\n"
"packages:\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 222
" - wireguard\n"
" - wireguard\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 223
" - qrencode\n"
" - qrencode\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 224
"runcmd:\n"
"runcmd:\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 225
" - sysctl -w net.ipv4.ip_forward=1\n"
" - sysctl -w net.ipv4.ip_forward=1\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 226
" - sysctl -w net.ipv6.conf.all.forwarding=1\n"
" - sysctl -w net.ipv6.conf.all.forwarding=1\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 227
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 228
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 229
raise RuntimeError(f'Unknown app "{app}". Supported: none, coolify, wireguard')
raise RuntimeError(f'Unknown app "{app}". Supported: none, coolify, wireguard')
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 230
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 231
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 232
def server_embed(server) -> discord.Embed:
def server_embed(server) -> discord.Embed:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 233
public_net = getattr(server, "public_net", None)
public_net = getattr(server, "public_net", None)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 234
ipv4 = public_net.ipv4.ip if public_net and getattr(public_net, "ipv4", None) else "N/A"
ipv4 = public_net.ipv4.ip if public_net and getattr(public_net, "ipv4", None) else "N/A"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 235
ipv6 = public_net.ipv6.ip if public_net and getattr(public_net, "ipv6", None) else "N/A"
ipv6 = public_net.ipv6.ip if public_net and getattr(public_net, "ipv6", None) else "N/A"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 236
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 237
dc = getattr(server, "datacenter", None)
dc = getattr(server, "datacenter", None)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 238
dc_name = dc.name if dc else "N/A"
dc_name = dc.name if dc else "N/A"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 239
loc = getattr(dc, "location", None) if dc else None
loc = getattr(dc, "location", None) if dc else None
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 240
loc_name = loc.name if loc else "N/A"
loc_name = loc.name if loc else "N/A"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 241
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 242
embed = discord.Embed(title=f"✅ VM Ready: {server.name}")
embed = discord.Embed(title=f"✅ VM Ready: {server.name}")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 243
embed.add_field(name="Server ID", value=str(server.id), inline=True)
embed.add_field(name="Server ID", value=str(server.id), inline=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 244
embed.add_field(name="Status", value=str(server.status), inline=True)
embed.add_field(name="Status", value=str(server.status), inline=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 245
embed.add_field(name="Type", value=server.server_type.name, inline=True)
embed.add_field(name="Type", value=server.server_type.name, inline=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 246
embed.add_field(name="Location", value=f"{dc_name} ({loc_name})", inline=False)
embed.add_field(name="Location", value=f"{dc_name} ({loc_name})", inline=False)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 247
embed.add_field(name="IPv4", value=ipv4, inline=True)
embed.add_field(name="IPv4", value=ipv4, inline=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 248
embed.add_field(name="IPv6", value=ipv6, inline=True)
embed.add_field(name="IPv6", value=ipv6, inline=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 249
embed.add_field(name="Image", value=(server.image.name if getattr(server, "image", None) else "N/A"), inline=False)
embed.add_field(name="Image", value=(server.image.name if getattr(server, "image", None) else "N/A"), inline=False)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 250
embed.set_footer(text="Hetzner Provisioner")
embed.set_footer(text="Hetzner Provisioner")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 251
return embed
return embed
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 252
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 253
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 254
def suggest_locations_text() -> str:
def suggest_locations_text() -> str:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 255
c = cache_required()
c = cache_required()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 256
names = sorted(c.locations.keys())
names = sorted(c.locations.keys())
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 257
return "Try a different location. Available (first 25): " + ", ".join(names[:25]) + (" …" if len(names) > 25 else "")
return "Try a different location. Available (first 25): " + ", ".join(names[:25]) + (" …" if len(names) > 25 else "")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 258
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 259
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 260
def suggest_x86_images_text() -> str:
def suggest_x86_images_text() -> str:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 261
c = cache_required()
c = cache_required()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 262
names = sorted(c.images_x86.keys())
names = sorted(c.images_x86.keys())
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 263
return "Valid x86 images (first 25): " + ", ".join(names[:25]) + (" …" if len(names) > 25 else "")
return "Valid x86 images (first 25): " + ", ".join(names[:25]) + (" …" if len(names) > 25 else "")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 264
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 265
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 266
def create_server(discord_user_id: int, name: str, location_name: str, image_name: str, app: str) -> object:
def create_server(discord_user_id: int, name: str, location_name: str, image_name: str, app: str) -> object:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 267
c = cache_required()
c = cache_required()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 268
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 269
st = c.server_types.get(DEFAULT_SERVER_TYPE)
st = c.server_types.get(DEFAULT_SERVER_TYPE)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 270
if not st:
if not st:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 271
raise RuntimeError(f"Server type {DEFAULT_SERVER_TYPE} not found in Hetzner.")
raise RuntimeError(f"Server type {DEFAULT_SERVER_TYPE} not found in Hetzner.")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 272
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 273
loc_key = (location_name or "").strip()
loc_key = (location_name or "").strip()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 274
loc = c.locations.get(loc_key)
loc = c.locations.get(loc_key)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 275
if not loc:
if not loc:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 276
raise RuntimeError(f'Unknown location "{location_name}". {suggest_locations_text()}')
raise RuntimeError(f'Unknown location "{location_name}". {suggest_locations_text()}')
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 277
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 278
img_key = (image_name or "").strip()
img_key = (image_name or "").strip()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 279
img = c.images_x86.get(img_key)
img = c.images_x86.get(img_key)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 280
if not img:
if not img:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 281
if img_key in c.images_all:
if img_key in c.images_all:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 282
actual = _img_arch(c.images_all[img_key])
actual = _img_arch(c.images_all[img_key])
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 283
raise RuntimeError(
raise RuntimeError(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 284
f"Image \"{img_key}\" is not x86-compatible (architecture: {actual})."
f"Image \"{img_key}\" is not x86-compatible (architecture: {actual})."
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 285
"Pick an x86 image. Use /images or autocomplete."
"Pick an x86 image. Use /images or autocomplete."
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 286
f"{suggest_x86_images_text()}"
f"{suggest_x86_images_text()}"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 287
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 288
raise RuntimeError(
raise RuntimeError(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 289
f'Unknown image "{img_key}". Use /images to list valid x86 options.\n'
f'Unknown image "{img_key}". Use /images to list valid x86 options.\n'
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 290
f"{suggest_x86_images_text()}"
f"{suggest_x86_images_text()}"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 291
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 292
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 293
user_data = cloud_init_for_app(app)
user_data = cloud_init_for_app(app)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 294
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 295
net_id, ssh_id, fw_id = db_get_defaults(discord_user_id)
net_id, ssh_id, fw_id = db_get_defaults(discord_user_id)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 296
net = pick_single_or_user_default("network", c.networks, net_id)
net = pick_single_or_user_default("network", c.networks, net_id)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 297
ssh_key = pick_single_or_user_default("SSH key", c.ssh_keys, ssh_id)
ssh_key = pick_single_or_user_default("SSH key", c.ssh_keys, ssh_id)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 298
firewall = pick_single_or_user_default("firewall", c.firewalls, fw_id)
firewall = pick_single_or_user_default("firewall", c.firewalls, fw_id)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 299
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 300
resp = hc.servers.create(
resp = hc.servers.create(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 301
name=name,
name=name,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 302
server_type=st,
server_type=st,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 303
image=img,
image=img,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 304
location=loc,
location=loc,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 305
networks=[net],
networks=[net],
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 306
ssh_keys=[ssh_key],
ssh_keys=[ssh_key],
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 307
firewalls=[firewall],
firewalls=[firewall],
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 308
user_data=(user_data if user_data else None),
user_data=(user_data if user_data else None),
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 309
labels={"managed_by": "discord-bot", "discord_user_id": str(discord_user_id)},
labels={"managed_by": "discord-bot", "discord_user_id": str(discord_user_id)},
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 310
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 311
return resp.server
return resp.server
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 312
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 313
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 314
intents = discord.Intents.default()
intents = discord.Intents.default()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 315
bot = commands.Bot(command_prefix="!", intents=intents)
bot = commands.Bot(command_prefix="!", intents=intents)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 316
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 317
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 318
def is_dm(interaction: discord.Interaction) -> bool:
def is_dm(interaction: discord.Interaction) -> bool:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 319
return interaction.guild is None
return interaction.guild is None
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 320
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 321
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 322
def _is_resource_limit_error(e: Exception) -> bool:
def _is_resource_limit_error(e: Exception) -> bool:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 323
s = str(e).lower()
s = str(e).lower()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 324
return ("resource_limit_exceeded" in s) or ("server limit reached" in s) or ("limit reached" in s)
return ("resource_limit_exceeded" in s) or ("server limit reached" in s) or ("limit reached" in s)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 325
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 326
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 327
def _server_quota_remaining() -> Optional[int]:
def _server_quota_remaining() -> Optional[int]:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 328
try:
try:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 329
limits = hc.limits.get()
limits = hc.limits.get()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 330
resources = getattr(limits, "resources", None)
resources = getattr(limits, "resources", None)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 331
if not resources:
if not resources:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 332
return None
return None
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 333
servers = getattr(resources, "servers", None)
servers = getattr(resources, "servers", None)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 334
if not servers:
if not servers:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 335
return None
return None
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 336
maxv = getattr(servers, "max", None)
maxv = getattr(servers, "max", None)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 337
used = getattr(servers, "used", None)
used = getattr(servers, "used", None)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 338
if maxv is None or used is None:
if maxv is None or used is None:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 339
return None
return None
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 340
return int(maxv) - int(used)
return int(maxv) - int(used)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 341
except Exception:
except Exception:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 342
return None
return None
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 343
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 344
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 345
async def safe_reply(
async def safe_reply(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 346
interaction: discord.Interaction,
interaction: discord.Interaction,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 347
content: Optional[str] = None,
content: Optional[str] = None,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 348
embed: Optional[discord.Embed] = None,
embed: Optional[discord.Embed] = None,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 349
ephemeral: bool = False,
ephemeral: bool = False,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 350
):
):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 351
if is_dm(interaction):
if is_dm(interaction):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 352
ephemeral = False
ephemeral = False
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 353
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 354
if interaction.response.is_done():
if interaction.response.is_done():
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 355
await interaction.followup.send(content=content, embed=embed, ephemeral=ephemeral)
await interaction.followup.send(content=content, embed=embed, ephemeral=ephemeral)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 356
else:
else:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 357
await interaction.response.send_message(content=content, embed=embed, ephemeral=ephemeral)
await interaction.response.send_message(content=content, embed=embed, ephemeral=ephemeral)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 358
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 359
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 360
async def send_long(interaction: discord.Interaction, text: str, ephemeral: bool = True) -> None:
async def send_long(interaction: discord.Interaction, text: str, ephemeral: bool = True) -> None:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 361
if text is None:
if text is None:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 362
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 363
ep = False if is_dm(interaction) else ephemeral
ep = False if is_dm(interaction) else ephemeral
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 364
chunks: List[str] = []
chunks: List[str] = []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 365
s = text
s = text
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 366
while len(s) > 1900:
while len(s) > 1900:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 367
cut = s.rfind("\n", 0, 1900)
cut = s.rfind("\n", 0, 1900)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 368
if cut == -1:
if cut == -1:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 369
cut = 1900
cut = 1900
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 370
chunks.append(s[:cut])
chunks.append(s[:cut])
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 371
s = s[cut:].lstrip("\n")
s = s[cut:].lstrip("\n")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 372
if s:
if s:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 373
chunks.append(s)
chunks.append(s)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 374
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 375
first = True
first = True
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 376
for chunk in chunks:
for chunk in chunks:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 377
if first and not interaction.response.is_done():
if first and not interaction.response.is_done():
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 378
await interaction.response.send_message(chunk, ephemeral=ep)
await interaction.response.send_message(chunk, ephemeral=ep)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 379
first = False
first = False
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 380
else:
else:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 381
await interaction.followup.send(chunk, ephemeral=ep)
await interaction.followup.send(chunk, ephemeral=ep)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 382
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 383
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 384
async def image_autocomplete(interaction: discord.Interaction, current: str) -> List[app_commands.Choice[str]]:
async def image_autocomplete(interaction: discord.Interaction, current: str) -> List[app_commands.Choice[str]]:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 385
try:
try:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 386
cur = (current or "").lower().strip()
cur = (current or "").lower().strip()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 387
if not AUTO_IMAGES_X86:
if not AUTO_IMAGES_X86:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 388
return []
return []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 389
names = AUTO_IMAGES_X86
names = AUTO_IMAGES_X86
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 390
if cur:
if cur:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 391
names = [n for n in names if cur in n.lower()]
names = [n for n in names if cur in n.lower()]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 392
return [app_commands.Choice(name=n, value=n) for n in names[:25]]
return [app_commands.Choice(name=n, value=n) for n in names[:25]]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 393
except Exception as e:
except Exception as e:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 394
print("image_autocomplete error:", repr(e))
print("image_autocomplete error:", repr(e))
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 395
return []
return []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 396
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 397
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 398
async def location_autocomplete(interaction: discord.Interaction, current: str) -> List[app_commands.Choice[str]]:
async def location_autocomplete(interaction: discord.Interaction, current: str) -> List[app_commands.Choice[str]]:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 399
try:
try:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 400
cur = (current or "").lower().strip()
cur = (current or "").lower().strip()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 401
if not AUTO_LOCATIONS:
if not AUTO_LOCATIONS:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 402
return []
return []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 403
names = AUTO_LOCATIONS
names = AUTO_LOCATIONS
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 404
if cur:
if cur:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 405
names = [n for n in names if cur in n.lower()]
names = [n for n in names if cur in n.lower()]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 406
return [app_commands.Choice(name=n, value=n) for n in names[:25]]
return [app_commands.Choice(name=n, value=n) for n in names[:25]]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 407
except Exception as e:
except Exception as e:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 408
print("location_autocomplete error:", repr(e))
print("location_autocomplete error:", repr(e))
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 409
return []
return []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 410
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 411
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 412
@bot.event
@bot.event
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 413
async def on_ready():
async def on_ready():
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 414
global HCACHE, AUTO_IMAGES_X86, AUTO_LOCATIONS
global HCACHE, AUTO_IMAGES_X86, AUTO_LOCATIONS
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 415
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 416
db_init()
db_init()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 417
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 418
HCACHE = await asyncio.to_thread(build_cache)
HCACHE = await asyncio.to_thread(build_cache)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 419
AUTO_IMAGES_X86 = sorted(HCACHE.images_x86.keys())
AUTO_IMAGES_X86 = sorted(HCACHE.images_x86.keys())
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 420
AUTO_LOCATIONS = sorted(HCACHE.locations.keys())
AUTO_LOCATIONS = sorted(HCACHE.locations.keys())
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 421
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 422
try:
try:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 423
await bot.tree.sync()
await bot.tree.sync()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 424
except Exception as e:
except Exception as e:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 425
print("Sync failed:", e)
print("Sync failed:", e)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 426
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 427
print(f"Logged in as {bot.user}")
print(f"Logged in as {bot.user}")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 428
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 429
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 430
@bot.tree.error
@bot.tree.error
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 431
async def on_app_command_error(interaction: discord.Interaction, error: app_commands.AppCommandError):
async def on_app_command_error(interaction: discord.Interaction, error: app_commands.AppCommandError):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 432
try:
try:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 433
await safe_reply(
await safe_reply(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 434
interaction,
interaction,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 435
content=f"❌ Command error:\n`{type(error).__name__}: {error}`",
content=f"❌ Command error:\n`{type(error).__name__}: {error}`",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 436
ephemeral=True,
ephemeral=True,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 437
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 438
except Exception:
except Exception:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 439
pass
pass
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 440
raise error
raise error
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 441
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 442
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 443
@bot.tree.command(name="create", description="Create a Hetzner VM (required: name, location, image)")
@bot.tree.command(name="create", description="Create a Hetzner VM (required: name, location, image)")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 444
@app_commands.describe(
@app_commands.describe(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 445
name="VM name",
name="VM name",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 446
location="Hetzner location (e.g. hel1, nbg1)",
location="Hetzner location (e.g. hel1, nbg1)",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 447
image="x86 image name (use /images to list all, autocomplete helps)",
image="x86 image name (use /images to list all, autocomplete helps)",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 448
app="Optional app install (none/coolify/wireguard) applied via cloud-init",
app="Optional app install (none/coolify/wireguard) applied via cloud-init",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 449
count="How many VMs to create (1-10)",
count="How many VMs to create (1-10)",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 450
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 451
@app_commands.autocomplete(location=location_autocomplete, image=image_autocomplete)
@app_commands.autocomplete(location=location_autocomplete, image=image_autocomplete)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 452
async def create_cmd(
async def create_cmd(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 453
interaction: discord.Interaction,
interaction: discord.Interaction,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 454
name: str,
name: str,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 455
location: str,
location: str,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 456
image: str,
image: str,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 457
app: Optional[str] = "none",
app: Optional[str] = "none",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 458
count: Optional[int] = 1,
count: Optional[int] = 1,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 459
):
):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 460
await interaction.response.defer(thinking=True)
await interaction.response.defer(thinking=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 461
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 462
base = (name or "").strip().upper()
base = (name or "").strip().upper()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 463
if not base:
if not base:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 464
await safe_reply(interaction, content="❌ Name can’t be empty.", ephemeral=True)
await safe_reply(interaction, content="❌ Name can’t be empty.", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 465
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 466
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 467
try:
try:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 468
n = int(count or 1)
n = int(count or 1)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 469
except Exception:
except Exception:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 470
await safe_reply(interaction, content="❌ count must be a number.", ephemeral=True)
await safe_reply(interaction, content="❌ count must be a number.", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 471
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 472
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 473
if n < 1 or n > 10:
if n < 1 or n > 10:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 474
await safe_reply(interaction, content="❌ count must be between 1 and 10.", ephemeral=True)
await safe_reply(interaction, content="❌ count must be between 1 and 10.", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 475
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 476
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 477
remaining = _server_quota_remaining()
remaining = _server_quota_remaining()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 478
if remaining is not None and remaining <= 0:
if remaining is not None and remaining <= 0:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 479
await safe_reply(interaction, content="❌ Hetzner server limit reached on this account.", ephemeral=True)
await safe_reply(interaction, content="❌ Hetzner server limit reached on this account.", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 480
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 481
if remaining is not None and n > remaining:
if remaining is not None and n > remaining:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 482
await safe_reply(
await safe_reply(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 483
interaction,
interaction,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 484
content=f"❌ You requested {n} VM(s), but your Hetzner account only has quota for {remaining} more.",
content=f"❌ You requested {n} VM(s), but your Hetzner account only has quota for {remaining} more.",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 485
ephemeral=True,
ephemeral=True,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 486
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 487
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 488
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 489
loc = (location or "").strip()
loc = (location or "").strip()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 490
img = (image or "").strip()
img = (image or "").strip()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 491
app_val = (app or "none").strip().lower()
app_val = (app or "none").strip().lower()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 492
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 493
planned_names: List[str] = [base] + [f"{base}{i}" for i in range(1, n)]
planned_names: List[str] = [base] + [f"{base}{i}" for i in range(1, n)]
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 494
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 495
created_ids: List[int] = []
created_ids: List[int] = []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 496
created_names: List[str] = []
created_names: List[str] = []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 497
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 498
for vm_name in planned_names:
for vm_name in planned_names:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 499
try:
try:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 500
server = await asyncio.to_thread(create_server, interaction.user.id, vm_name, loc, img, app_val)
server = await asyncio.to_thread(create_server, interaction.user.id, vm_name, loc, img, app_val)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 501
except Exception as e:
except Exception as e:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 502
if _is_resource_limit_error(e):
if _is_resource_limit_error(e):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 503
msg = "❌ Hetzner server limit reached on this account."
msg = "❌ Hetzner server limit reached on this account."
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 504
else:
else:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 505
msg = f"❌ Failed creating VM:\n`{e}`"
msg = f"❌ Failed creating VM:\n`{e}`"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 506
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 507
if created_names:
if created_names:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 508
await safe_reply(
await safe_reply(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 509
interaction,
interaction,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 510
content=(
content=(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 511
"❌ Failed creating one of the VMs.\n"
"❌ Failed creating one of the VMs.\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 512
f"Created so far: {', '.join(created_names)}\n\n"
f"Created so far: {', '.join(created_names)}\n\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 513
+ (msg if _is_resource_limit_error(e) else f"Error: `{e}`")
+ (msg if _is_resource_limit_error(e) else f"Error: `{e}`")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 514
),
),
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 515
ephemeral=True,
ephemeral=True,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 516
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 517
else:
else:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 518
await safe_reply(interaction, content=msg, ephemeral=True)
await safe_reply(interaction, content=msg, ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 519
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 520
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 521
db_add_server(interaction.user.id, server.id, server.name)
db_add_server(interaction.user.id, server.id, server.name)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 522
created_ids.append(int(server.id))
created_ids.append(int(server.id))
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 523
created_names.append(server.name)
created_names.append(server.name)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 524
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 525
await asyncio.sleep(20)
await asyncio.sleep(20)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 526
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 527
embeds: List[discord.Embed] = []
embeds: List[discord.Embed] = []
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 528
for sid in created_ids:
for sid in created_ids:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 529
try:
try:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 530
srv = hc.servers.get_by_id(sid)
srv = hc.servers.get_by_id(sid)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 531
embeds.append(server_embed(srv))
embeds.append(server_embed(srv))
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 532
except Exception as e:
except Exception as e:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 533
await safe_reply(interaction, content=f"⚠️ Created server {sid}, but fetch failed: `{e}`", ephemeral=True)
await safe_reply(interaction, content=f"⚠️ Created server {sid}, but fetch failed: `{e}`", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 534
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 535
if not embeds:
if not embeds:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 536
await safe_reply(interaction, content="⚠️ VMs created, but I couldn’t fetch details.", ephemeral=True)
await safe_reply(interaction, content="⚠️ VMs created, but I couldn’t fetch details.", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 537
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 538
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 539
for i in range(0, len(embeds), 10):
for i in range(0, len(embeds), 10):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 540
await safe_reply(interaction, embed=embeds[i], ephemeral=True)
await safe_reply(interaction, embed=embeds[i], ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 541
for extra in embeds[i + 1 : i + 10]:
for extra in embeds[i + 1 : i + 10]:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 542
await interaction.followup.send(embed=extra, ephemeral=(not is_dm(interaction)))
await interaction.followup.send(embed=extra, ephemeral=(not is_dm(interaction)))
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 543
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 544
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 545
@bot.tree.command(name="s", description="Get info about one of your servers (by name or ID)")
@bot.tree.command(name="s", description="Get info about one of your servers (by name or ID)")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 546
@app_commands.describe(server="Server name or ID")
@app_commands.describe(server="Server name or ID")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 547
async def s_cmd(interaction: discord.Interaction, server: str):
async def s_cmd(interaction: discord.Interaction, server: str):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 548
sid = db_find_server(interaction.user.id, server)
sid = db_find_server(interaction.user.id, server)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 549
if not sid:
if not sid:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 550
await safe_reply(interaction, content="I can’t find that server under your user.", ephemeral=True)
await safe_reply(interaction, content="I can’t find that server under your user.", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 551
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 552
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 553
try:
try:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 554
srv = hc.servers.get_by_id(sid)
srv = hc.servers.get_by_id(sid)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 555
except Exception as e:
except Exception as e:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 556
await safe_reply(interaction, content=f"Fetch failed:\n`{e}`", ephemeral=True)
await safe_reply(interaction, content=f"Fetch failed:\n`{e}`", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 557
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 558
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 559
await safe_reply(interaction, embed=server_embed(srv), ephemeral=True)
await safe_reply(interaction, embed=server_embed(srv), ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 560
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 561
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 562
@bot.tree.command(name="refresh", description="Refresh Hetzner options cache")
@bot.tree.command(name="refresh", description="Refresh Hetzner options cache")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 563
async def refresh_cmd(interaction: discord.Interaction):
async def refresh_cmd(interaction: discord.Interaction):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 564
global HCACHE, AUTO_IMAGES_X86, AUTO_LOCATIONS
global HCACHE, AUTO_IMAGES_X86, AUTO_LOCATIONS
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 565
await safe_reply(interaction, content="Refreshing Hetzner cache…", ephemeral=True)
await safe_reply(interaction, content="Refreshing Hetzner cache…", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 566
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 567
try:
try:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 568
HCACHE = await asyncio.to_thread(build_cache)
HCACHE = await asyncio.to_thread(build_cache)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 569
AUTO_IMAGES_X86 = sorted(HCACHE.images_x86.keys())
AUTO_IMAGES_X86 = sorted(HCACHE.images_x86.keys())
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 570
AUTO_LOCATIONS = sorted(HCACHE.locations.keys())
AUTO_LOCATIONS = sorted(HCACHE.locations.keys())
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 571
except Exception as e:
except Exception as e:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 572
await safe_reply(interaction, content=f"❌ Refresh failed:\n`{e}`", ephemeral=True)
await safe_reply(interaction, content=f"❌ Refresh failed:\n`{e}`", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 573
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 574
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 575
await safe_reply(
await safe_reply(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 576
interaction,
interaction,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 577
content=(
content=(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 578
"✅ Refreshed.\n"
"✅ Refreshed.\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 579
f"Locations: {len(HCACHE.locations)}\n"
f"Locations: {len(HCACHE.locations)}\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 580
f"Server types: {len(HCACHE.server_types)}\n"
f"Server types: {len(HCACHE.server_types)}\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 581
f"Images(all): {len(HCACHE.images_all)}\n"
f"Images(all): {len(HCACHE.images_all)}\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 582
f"Images(x86): {len(HCACHE.images_x86)}\n"
f"Images(x86): {len(HCACHE.images_x86)}\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 583
f"Networks: {len(HCACHE.networks)}\n"
f"Networks: {len(HCACHE.networks)}\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 584
f"SSH keys: {len(HCACHE.ssh_keys)}\n"
f"SSH keys: {len(HCACHE.ssh_keys)}\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 585
f"Firewalls: {len(HCACHE.firewalls)}"
f"Firewalls: {len(HCACHE.firewalls)}"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 586
),
),
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 587
ephemeral=True,
ephemeral=True,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 588
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 589
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 590
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 591
@bot.tree.command(name="images", description="List ALL valid x86 image names (compatible with cx23)")
@bot.tree.command(name="images", description="List ALL valid x86 image names (compatible with cx23)")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 592
async def images_cmd(interaction: discord.Interaction):
async def images_cmd(interaction: discord.Interaction):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 593
c = cache_required()
c = cache_required()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 594
names = sorted(c.images_x86.keys())
names = sorted(c.images_x86.keys())
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 595
text = "x86 Images:\n" + _top(names, n=len(names))
text = "x86 Images:\n" + _top(names, n=len(names))
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 596
await send_long(interaction, text, ephemeral=True)
await send_long(interaction, text, ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 597
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 598
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 599
@bot.tree.command(name="locations", description="List available Hetzner locations")
@bot.tree.command(name="locations", description="List available Hetzner locations")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 600
async def locations_cmd(interaction: discord.Interaction):
async def locations_cmd(interaction: discord.Interaction):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 601
c = cache_required()
c = cache_required()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 602
names = sorted(c.locations.keys())
names = sorted(c.locations.keys())
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 603
text = "Locations:\n" + _top(names, n=min(len(names), 200))
text = "Locations:\n" + _top(names, n=min(len(names), 200))
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 604
await send_long(interaction, text, ephemeral=True)
await send_long(interaction, text, ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 605
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 606
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 607
@bot.tree.command(name="networks", description="List networks discovered from Hetzner")
@bot.tree.command(name="networks", description="List networks discovered from Hetzner")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 608
async def networks_cmd(interaction: discord.Interaction):
async def networks_cmd(interaction: discord.Interaction):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 609
c = cache_required()
c = cache_required()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 610
lines = sorted([f"- {n.name} (id {n.id})" for n in c.networks.values()])
lines = sorted([f"- {n.name} (id {n.id})" for n in c.networks.values()])
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 611
text = "Networks:\n" + ("\n".join(lines) if lines else "None")
text = "Networks:\n" + ("\n".join(lines) if lines else "None")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 612
await send_long(interaction, text, ephemeral=True)
await send_long(interaction, text, ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 613
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 614
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 615
@bot.tree.command(name="sshkeys", description="List SSH keys discovered from Hetzner")
@bot.tree.command(name="sshkeys", description="List SSH keys discovered from Hetzner")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 616
async def sshkeys_cmd(interaction: discord.Interaction):
async def sshkeys_cmd(interaction: discord.Interaction):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 617
c = cache_required()
c = cache_required()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 618
lines = sorted([f"- {k.name} (id {k.id})" for k in c.ssh_keys.values()])
lines = sorted([f"- {k.name} (id {k.id})" for k in c.ssh_keys.values()])
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 619
text = "SSH keys:\n" + ("\n".join(lines) if lines else "None")
text = "SSH keys:\n" + ("\n".join(lines) if lines else "None")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 620
await send_long(interaction, text, ephemeral=True)
await send_long(interaction, text, ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 621
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 622
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 623
@bot.tree.command(name="firewalls", description="List firewalls discovered from Hetzner")
@bot.tree.command(name="firewalls", description="List firewalls discovered from Hetzner")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 624
async def firewalls_cmd(interaction: discord.Interaction):
async def firewalls_cmd(interaction: discord.Interaction):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 625
c = cache_required()
c = cache_required()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 626
lines = sorted([f"- {f.name} (id {f.id})" for f in c.firewalls.values()])
lines = sorted([f"- {f.name} (id {f.id})" for f in c.firewalls.values()])
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 627
text = "Firewalls:\n" + ("\n".join(lines) if lines else "None")
text = "Firewalls:\n" + ("\n".join(lines) if lines else "None")
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 628
await send_long(interaction, text, ephemeral=True)
await send_long(interaction, text, ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 629
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 630
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 631
@bot.tree.command(
@bot.tree.command(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 632
name="setdefaults",
name="setdefaults",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 633
description="Set defaults (only needed if you have multiple networks/ssh keys/firewalls)",
description="Set defaults (only needed if you have multiple networks/ssh keys/firewalls)",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 634
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 635
@app_commands.describe(
@app_commands.describe(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 636
network_id="Default network ID",
network_id="Default network ID",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 637
ssh_key_id="Default SSH key ID",
ssh_key_id="Default SSH key ID",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 638
firewall_id="Default firewall ID",
firewall_id="Default firewall ID",
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 639
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 640
async def setdefaults_cmd(
async def setdefaults_cmd(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 641
interaction: discord.Interaction,
interaction: discord.Interaction,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 642
network_id: Optional[int] = None,
network_id: Optional[int] = None,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 643
ssh_key_id: Optional[int] = None,
ssh_key_id: Optional[int] = None,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 644
firewall_id: Optional[int] = None,
firewall_id: Optional[int] = None,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 645
):
):
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 646
c = cache_required()
c = cache_required()
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 647
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 648
if network_id is not None and network_id not in c.networks:
if network_id is not None and network_id not in c.networks:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 649
await safe_reply(interaction, content=f"Unknown network_id {network_id}. Use /networks to list.", ephemeral=True)
await safe_reply(interaction, content=f"Unknown network_id {network_id}. Use /networks to list.", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 650
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 651
if ssh_key_id is not None and ssh_key_id not in c.ssh_keys:
if ssh_key_id is not None and ssh_key_id not in c.ssh_keys:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 652
await safe_reply(interaction, content=f"Unknown ssh_key_id {ssh_key_id}. Use /sshkeys to list.", ephemeral=True)
await safe_reply(interaction, content=f"Unknown ssh_key_id {ssh_key_id}. Use /sshkeys to list.", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 653
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 654
if firewall_id is not None and firewall_id not in c.firewalls:
if firewall_id is not None and firewall_id not in c.firewalls:
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 655
await safe_reply(interaction, content=f"Unknown firewall_id {firewall_id}. Use /firewalls to list.", ephemeral=True)
await safe_reply(interaction, content=f"Unknown firewall_id {firewall_id}. Use /firewalls to list.", ephemeral=True)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 656
return
return
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 657
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 658
db_set_defaults(interaction.user.id, network_id, ssh_key_id, firewall_id)
db_set_defaults(interaction.user.id, network_id, ssh_key_id, firewall_id)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 659
await safe_reply(
await safe_reply(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 660
interaction,
interaction,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 661
content=(
content=(
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 662
"✅ Defaults saved:\n"
"✅ Defaults saved:\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 663
f"- network_id: {network_id}\n"
f"- network_id: {network_id}\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 664
f"- ssh_key_id: {ssh_key_id}\n"
f"- ssh_key_id: {ssh_key_id}\n"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 665
f"- firewall_id: {firewall_id}"
f"- firewall_id: {firewall_id}"
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 666
),
),
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 667
ephemeral=True,
ephemeral=True,
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 668
)
)
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 669
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 670
same change
7535a60
Initial commit
- Full commit hash
7535a60ae0497f7561f00efdcf83193d8cb112ec- Author
- Alex Carrington <[email protected]>
- Date
- 7 months ago
- Selected line
- 671
bot.run(DISCORD_TOKEN)
bot.run(DISCORD_TOKEN)