style: replace GetConfig() with variable C_globalConfig

This commit is contained in:
2026-09-02 21:24:27 +08:00
parent bf4cdf0d88
commit 16341972af
13 changed files with 44 additions and 49 deletions
@@ -155,7 +155,7 @@ func (c *Client) SendMsg(targetType string, targetID int64, msg string, hasAt bo
return nil, fmt.Errorf("failed to marshal request: %w", err)
}
if config.GetGlobalConfig().Debug.ShowNapcatAction {
if config.C_globalConfig.Debug.ShowNapcatAction {
postLog.Debug(fmt.Sprintf("[Napcat] SendMsg -> %s (%s): %s", endpoint, targetType, message))
}
@@ -176,7 +176,7 @@ func (c *Client) RecallMsg(msgID int64) (*APIResponse, error) {
return nil, fmt.Errorf("failed to marshal request: %w", err)
}
if config.GetGlobalConfig().Debug.ShowNapcatAction {
if config.C_globalConfig.Debug.ShowNapcatAction {
postLog.Debug(fmt.Sprintf("[Napcat] RecallMsg -> /delete_msg: %d", msgID))
}
@@ -190,7 +190,7 @@ func (c *Client) RecallMsg(msgID int64) (*APIResponse, error) {
// GetGroupList retrieves the list of joined groups from NapCat.
func (c *Client) GetGroupList() (*APIResponse, error) {
if config.GetGlobalConfig().Debug.ShowNapcatAction {
if config.C_globalConfig.Debug.ShowNapcatAction {
postLog.Debug("[Napcat] GetGroupList -> /get_group_list")
}
@@ -211,7 +211,7 @@ func (c *Client) GetGroupInfo(groupID int64) (*APIResponse, error) {
return nil, fmt.Errorf("failed to marshal request: %w", err)
}
if config.GetGlobalConfig().Debug.ShowNapcatAction {
if config.C_globalConfig.Debug.ShowNapcatAction {
postLog.Debug(fmt.Sprintf("[Napcat] GetGroupInfo -> /get_group_info: %d", groupID))
}
@@ -225,7 +225,7 @@ func (c *Client) GetGroupInfo(groupID int64) (*APIResponse, error) {
// GetFriendsList retrieves the friends list from NapCat.
func (c *Client) GetFriendsList() (*APIResponse, error) {
if config.GetGlobalConfig().Debug.ShowNapcatAction {
if config.C_globalConfig.Debug.ShowNapcatAction {
postLog.Debug("[Napcat] GetFriendsList -> /get_friend_list")
}