Skip to content

Commit

Permalink
update typings
Browse files Browse the repository at this point in the history
  • Loading branch information
www committed Nov 24, 2024
1 parent 1db5246 commit 32340f2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 28 deletions.
38 changes: 10 additions & 28 deletions core/go.std/silverpelt/config_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ type CanonicalSettingsError struct {
Max uint64 `json:"max"`
Current uint64 `json:"current"`
} `json:"MaximumCountReached,omitempty"`
PermissionError *struct {
Result PermissionResult `json:"result"`
} `json:"PermissionError,omitempty"`
}

type CanonicalColumnType struct {
Expand Down Expand Up @@ -96,15 +99,6 @@ type CanonicalColumnSuggestion struct {
Static *struct {
Suggestions []string `json:"suggestions"`
} `json:"Static,omitempty"`
// A reference to another setting
//
// The primary key of the referred setting is used as the value
SettingsReference *struct {
// The module of the referenced setting
Module string `json:"module"`
// The setting of the referenced setting
Setting string `json:"setting"`
} `json:"SettingsReference,omitempty"`
None *struct{} `json:",omitempty"`
}

Expand All @@ -115,17 +109,10 @@ type CanonicalColumn struct {
ColumnType CanonicalColumnType `json:"column_type"`
Nullable bool `json:"nullable"`
Suggestions CanonicalColumnSuggestion `json:"suggestions"`
Unique bool `json:"unique"`
Secret bool `json:"secret"`
IgnoredFor []CanonicalOperationType `json:"ignored_for"`
}

type CanonicalOperationSpecific struct {
CorrespondingCommand string `json:"corresponding_command"`
ColumnIDs []string `json:"column_ids"`
ColumnsToSet orderedmap.OrderedMap[string, string] `json:"columns_to_set"`
}

type CanonicalOperationType string

const (
Expand Down Expand Up @@ -154,16 +141,11 @@ func (c CanonicalOperationType) Parse() bool {
}

type CanonicalConfigOption struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Table string `json:"table"`
CommonFilters orderedmap.OrderedMap[CanonicalOperationType, orderedmap.OrderedMap[string, string]] `json:"common_filters"`
DefaultCommonFilters orderedmap.OrderedMap[string, string] `json:"default_common_filters"`
PrimaryKey string `json:"primary_key"`
TitleTemplate string `json:"title_template"`
Columns []CanonicalColumn `json:"columns"`
MaxReturn int `json:"max_return"`
MaxEntries uint64 `json:"max_entries"`
Operations orderedmap.OrderedMap[CanonicalOperationType, CanonicalOperationSpecific] `json:"operations"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
PrimaryKey string `json:"primary_key"`
TitleTemplate string `json:"title_template"`
Columns []CanonicalColumn `json:"columns"`
Operations []CanonicalOperationType `json:"operations"`
}
11 changes: 11 additions & 0 deletions services/rust.bot/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,17 @@ async fn event_listener<'a>(
.ready
.insert(ctx.serenity_context.shard_id, true);

let ctx = ctx.serenity_context.clone();
let _ = tokio::task::spawn(async move {
match bot_binutils::on_startup(ctx).await {
Ok(_) => {}
Err(e) => {
error!("Error in on_startup: {}", e);
std::process::exit(1);
}
};
});

drop(_lock);
}
_ => {}
Expand Down

0 comments on commit 32340f2

Please sign in to comment.